answersLogoWhite

0

Perfectly legal.

User Avatar

Wiki User

14y ago

What else can I help you with?

Continue Learning about Engineering

Difference between break and continue statements in wml?

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;


Can break statement be used without any loop?

The Break statement should generally get executed in some loop or switch statement. The below code will give compiler error. void main() { printf("12"); break; printf("14"); }


What are break and continue statement in c language?

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).


How do you break a loop in a switch case statement?

using break; statement


What must happen before the while loop will stop iterating?

The while loop will stop iterating if its condition is no longer true when it reaches the end of an iteration, or if it encounters a break statement.

Related Questions

What is the purpose of break statement in c?

The break statement exits control of the innermost for, while or do-while loop, or switch statement.


Difference between break and continue statements in wml?

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;


How can you use the "break" statement in Java to prematurely exit a "for" loop?

In Java, you can use the "break" statement within a "for" loop to exit the loop prematurely. When the "break" statement is encountered, the loop will immediately stop executing and the program will continue with the code after the loop.


Can break statement be used without any loop?

The Break statement should generally get executed in some loop or switch statement. The below code will give compiler error. void main() { printf("12"); break; printf("14"); }


What are break and continue statement in c language?

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).


How do you break a loop in a switch case statement?

using break; statement


How do you convert a while loop to do-while loop?

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 .


What is purpose of break statement?

to terminate a loop.


What must happen before the while loop will stop iterating?

The while loop will stop iterating if its condition is no longer true when it reaches the end of an iteration, or if it encounters a break statement.


What is the different between break and continue?

The break statement exits out of the smallest containing loop or switch-case statement. The continue statement transfers control to the next iteration of the smallest containing loop statement.


What are control structures used in javascript?

The control structures used in java script are if-statement, for-loop, for-in loop, while loop,do-while loop, switch-statement, with-statement. try-catch-finally statements.


Can you write switch statement with in while loop?

Yes. The same goes for for-loop and do-while-loop.