answersLogoWhite

0

The break statement will immediately jump to the end of the current block of code.

The continue statement will skip the rest of the code in the current loop block and will return to the evaluation part of the loop. In a do or while loop, the condition will be tested and the loop will keep executing or exit as necessary. In a for loop, the counting expression (rightmost part of the for loop declaration) will be evaluated and then the condition will be tested.

Example:

#include main() { int i; int j = 10; for( i = 0; i <= j; i ++ ) { if( i == 5 ) { continue; } printf("Hello %d\n", i ); } } #include main() { int i; int j = 10; for( i = 0; i <= j; i ++ ) { if( i == 5 ) { continue; } printf("Hello %d\n", i ); } } #include main() { int i; int j = 10; for( i = 0; i <= j; i ++ ) { if( i == 5 ) { continue; } printf("Hello %d\n", i ); } }

for(int i = 0; i < 10; i++){

if(i == 0) continue;

DoSomeThingWith(i);

}

will not execute DoSomeThingWith for i = 0, but the loop will continue and DoSomeThingWith will be executed for i = 1 to i = 9.

User Avatar

Wiki User

12y ago

What else can I help you with?

Related Questions

What are all the looping statements in c?

1. goto 2. while-break-continue 3. for-break-continue 4. do-while-break-continue 5. recoursion


Write a c for goto statement?

AGAIN: puts ("c"); goto AGAIN;


Difference between goto and continue statement in c language?

In continue statement, we immediately continue next step through loop In go to statement, we go to in perfect label which we call.


What is the difference between C and advanced C?

The difference between C and the advanced C is that C is basic. On the other hand, the advanced C is thorough and to the detail.


Difference between C and C programming language?

The C and C programming languages are one and the same. There is no difference between those languages.


What is the difference between c c?

ketchup!


What is the difference between 28C and 25C?

The difference between 28°C and 25°C is 3°C. This means that 28°C is 3 degrees warmer than 25°C.


Why goto in c is a bad command?

A 'goto' statement immediately moves the execution of code to another part of the program. This makes the code difficult to follow and to debug. It is better practice to use If-then-else constructs to structure the program code.


What are difference between grade a b and c material?

The main difference is in between grade A,B &amp; C IS THE CARBON CONTAIN OF THE MATERIALS.


What is the difference between 134 C and -170 C?

the answer is 304C


What is the difference between object and variable in c?

There is no objects in C.


What are different types of control statements available in c?

1. goto, break, continue, return 2. if-else, switch-case-default 3. while, for, do-while