answersLogoWhite

0

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

User Avatar

Wiki User

14y ago

What else can I help you with?

Related Questions

What is the purpose of Continue and break statement in C?

The break statement is frequently used to terminate the processing of a particular case within a switch statement. Lack of an enclosing iterative or switch statement generates an error.Within nested statements, the break statement terminates only the do, for, switch, or whilestatement that immediately encloses it. You can use a returnor goto statement to transfer control elsewhere out of the nested structure.This example illustrates the break statement:#include int main() { char c; for(;;) { printf_s( "\nPress any key, Q to quit: " ); // Convert to character value scanf_s("%c", &c); if (c == 'Q') break; } } // Loop exits only when 'Q' is pressed


What is purpose of break statement?

to terminate a loop.


What is break in c?

The break statement is used to exit a loop or switch-case.


What advantage does Java's break statement have over C's break statement?

They do the same thing, but only the former can be used in a Java program.


What happens by the scanf statement in c?

It's a function, not a statement. Use your help system to find out its purpose.


What is the use of break in c programming?

The break statement is used to exit the nearest enclosing scope. Control passes to the first statement that comes after that enclosing scope.


Calling a function from switch in C?

Yes, you can call a function from within a switch statement in C. switch (i) { case 0: function1(i); break; case 1: function2(i); break; default: function3(i); break; } When the function returns, you will still be in the switch statement.


Which purpose you want to use return statement in c?

Surprise, surprise: returning from a function.


How many arithmetic statement in c?

Only one: expression. Yes, in C expression is one of the statements. Some other statements are: if, do, goto, while, for, switch, break, continue, return, NULL-statement, compound-statement.


Why you use if and else statement in c language program?

There is no "elseif" statement in C. You can only use "else" and "if" separately. This is a good reason for switch/case/break.


How can we use break statement in c?

press the following keys on your keyboard: b r e a k ;


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

using break; statement