yes for all Basic.
Yes
Not sure what is meant by 'program a Christmas tree' The basic form of For_Next loop is as follows For i As Integer = 1 To 10 ' Insert statements to operate with current values of i. Next i The loop steps through specified values of i, incrementing the value by 1 for every iteration.
You can use zero or more while-loops, there is no limit.
For i as integer = 1 to 10 ....... Next i
Break statements:-its terminates the current while or for loop and continue the program execution from the statement following the terminated.NOTE:-note that it is wmlscript syntax error to use the break statement outside of while or a for statements.example;Breakstatement:Break;Continue statement:-this statement terminate execution of a block of statementin while or for loop and continues execution of loop with the next iteration.note that the continue statement does not terminate the execution of loop and also is wmlscript syntax error to use the break statement outside of while or a for statements.-> in while loop, it jumps back to the condition.-> in for loop,it jumpsto the update expression.syntax:continuestatement:continue;
Both loops are used for repetition.For..next is also called counter loop.For...next loop executes statements for a certain number of time.WHILE ..wend loop executes the statement until a given condition remains true.if the programer knows the repetition in advance then for..next loop is used.if not then while..wend loop is used.
Not sure what is meant by 'program a Christmas tree' The basic form of For_Next loop is as follows For i As Integer = 1 To 10 ' Insert statements to operate with current values of i. Next i The loop steps through specified values of i, incrementing the value by 1 for every iteration.
You can use zero or more while-loops, there is no limit.
For i as integer = 1 to 10 ....... Next i
Break statements:-its terminates the current while or for loop and continue the program execution from the statement following the terminated.NOTE:-note that it is wmlscript syntax error to use the break statement outside of while or a for statements.example;Breakstatement:Break;Continue statement:-this statement terminate execution of a block of statementin while or for loop and continues execution of loop with the next iteration.note that the continue statement does not terminate the execution of loop and also is wmlscript syntax error to use the break statement outside of while or a for statements.-> in while loop, it jumps back to the condition.-> in for loop,it jumpsto the update expression.syntax:continuestatement:continue;
Both loops are used for repetition.For..next is also called counter loop.For...next loop executes statements for a certain number of time.WHILE ..wend loop executes the statement until a given condition remains true.if the programer knows the repetition in advance then for..next loop is used.if not then while..wend loop is used.
A for loop is classified as an iteration statement. A simple example might be... For x = 1 To 10 'loop body Next x The same loop expressed as a while loop (classified as a control flow statement) could be... x = 0 Do While x < 11 'loop body x = x + 1 Loop .
while- It will wrok only if the condition is correct if not it wont excute the body of the loop do-while: In some cases we want that body of the loop and the condition may fails so the loop want to print so the do while loop first excute body of the loop and next it checks the condition it continues until the condition becomes false
loop within in a loop is called for next loop
the test condition will be checked first after wards the body of the loop will be excuted in while statement and the the do while statement represented the body of the loop will be executed first and then the test condition will checked next
Break is used to exit the closest loop. Continue will cause the program to go to the beginning of the loop. for(int x=0;x<10;x++) { //continue; for(int y=0;y<10;y++) { break; } } The break statement causes the inner loop to stop at the first iteration. If the continue statement was uncommented, the inner loop would never be executed because the program would jump back to the beginning(until x = 10 of course).
There several methods: For/Next loop Do/While/Until loops You can have Do Loops within Do Loops.
A for loop is typically used to implement a counted loop: for x=0 to 100 step 1 print x next x