answersLogoWhite

0

Because you have to repeat something. (Or you can use while-loop, too.)

User Avatar

Wiki User

∙ 15y ago

What else can I help you with?

Continue Learning about Engineering
Related Questions

Can a continue statement be used in a switch statement?

If you have a loop in your switch statement or around your switch statement, you can use the continue statement in that. You cannot use a continue statement outside of a loop (do, for, or while).


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"); }


Why you use if loop in telecoms?

No such thing as if-loop. if-else statement is not a loop.


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.


What is the difference between 'switch' statement and 'if' statement?

we can use switch statement in multiple time but in if statement we can not use multiple time


Why break statement is optional in c plus plus?

You use a break statement to end execution of the enclosing iterator (loop) or switch statement. If omitted at the end of a case label, execution continues to the next case label, including the default case, until a jump statement is encountered (break, goto or return) or the switch statement falls from scope. Sometimes this can be desirable behaviour, thus the use of break is optional. A break statement is always optional at the end of the default case, or the last case label. Its usage in loops is always optional, to allow a loop to end prematurely regardless of the conditional expression that controls the loop.


Why you use while function in c?

It is a statement; you can create a loop with it: while (<condition>) <statement>


Is it possible to use a for loop in place of a while loop?

Yes. while loop consist of only condition statement to make for loop look as while loop we can use syntax shown below: for(;condition;) eg: for(;i<=n;)


What is the difference between while dowhile?

While: If we can use while statement it will check the condition then proceed further loop statement.DoWhile: If we use dowhile, first execute loop statement then check the condition.


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 a loop be structured so that it terminates a statement in the middle of its block?

I think you want to use statement break.


How do you use logic inside switch statement?

Nothing special, eg:switch (c) {case 'A':/* use any 'logic' you want */break;default:/* use any 'logic' you want */}

Trending Questions
What word means This type of volcanic dust revolutionized the work of architects by providing a new kind of building material concrete? Is sizeof an operator or function why? How do you link a programming with other programming languages? How does technical elements help or hinder a production? A 100 ohm resistor is placed across a 100v power source what is the power? What does it mean when a stator is shunting? What advantage does a statistical multiplexer have over a TDM multiplexer or an FDM multiplexer? What are the rules for sorting the information? Explain did jethro Tulls seed drill enabled farmers to yield larger crops? Selection and Repetition Control Structures Prepare a 3 to4 page paper that addresses the following- Selection Control Structures Explain how selection control structures increase the usefulness and? What are the various equation methods of enriching uranium 235 from its natural form? What is 'x' in steel grade 'x-70'? Can you say yhgbyhugkhgdfzdhhfhcg cnc ncjcvjfdcjfdjdihjkhlkjlkjlkjkkllkcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccckjjjjjjjjjjjjjjjjjjjjjjjjjj you? Is stevia bad for you? The genetic code is universal but what does this mean? How do you shut in a oil well with a subsea bop? Is PN16 the same as ANSI 150? What kind of styles are located in a separate css file and linked to the HTML language? What are you increasing by using more batteries? Draw 3 example each of the 6 types of simple machines?