'A loop goes around and around until the condition is met
'Example of a Do While Loop- NOTE: intNum must be dimensioned
intNum =1 'If you don't set intNum to 1 then intNum = 0
Do While IntNum <=3
MessageBox.Show (intNum.ToString)
intNum= intNum +1
Loop
-------------------------------------------------------------------
'Example of a Do Until Loop:
intNum = 1
Do Until IntNum > 3
MessageBox.Show (intNum.ToString)
intNum= intNum +1
Loop
In the comment section, tell the output of each program for 5 points
intNum adds 1 every time untill its greater than three and jumps out of loop
ReplyDeletethe first one will keep going until three and the second one will keep going until it is greater then three.
ReplyDeleteFor the first one, it will keep displaying the intnum in a message box untill it hits 3.
ReplyDeleteFor the second one, it will do the same thing untill it is greater then 3.
the first will add until it is equal to 3 the second will go until it is greater than 3
ReplyDeleteThe first time around will continue to go until it reaches 3.
ReplyDeleteThe second time will go on until it is greater than 3.
The first one will keep going until three and the second one will keep going until it is greater than three.
ReplyDeletenicely put Scott
ReplyDeleteThis comment has been removed by the author.
ReplyDelete1st one will go until it equals 3 and the 2nd will go until its higher than 3.
ReplyDeleteThe first time around will continue to go until it reaches 3.
ReplyDeleteThe second time will go on until it is greater than 3.