Conditional statements and Loop structure

If…Then..Else Statement

It conditionally executes a group of statements depending upon value of the expression. If…Then…Else block is used to define several blocks of statements ,in order to execute one block. Syntax: If <condition>then [statements] Else if <condition>Then [else if statement] . . . Else [elsestatement] End If Example: If a<10 then a=a+10 elseif a>15 then a=a-10 …

If…Then..Else Statement Read More »

Do…Loop Structure

Do…loop is used to execute a block of statements for indefinite number of times. There are several variations of Do…Loop statement. Each variation evaluates a numeric condition to determine whether to continue execution or not. Syntax: Do While <condition> statements… Loop Note that: 1.When Visual Basic executes Do While loop, it first tests condition. 2.If …

Do…Loop Structure Read More »

Scroll to Top