Type of loop in VB with syntax and example?

TYPES OF LOOP / ITERATAION

There are two types of loop.

1)            For—Next

2)            Do While(Do)

FOR—NEXT

For—Next loops required that you know how many time statement in the loop executed.

SYNTAX

For counter=start [increment]

Statement

Next

DO—WHILE

If execute a block of statement one or more line for as long as the condition is true. Vb is evaluates expression, and it is true the statement are executed of If the expression is false the program continuous and statement following the loop is executed.

SYNTAX

Do While condition

Statement

Loop

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s