Break
- This statement is used with switch statement.
- Can also be used with while loop, do – while loop and for loop.
- When the control encounters a break statement, the control will terminate the loop immediately and the statements after break will not be executed.
Syntax

Sample Code
[pastacode lang=”c” manual=”%23include%3Cstdio.h%3E%0Aint%20main()%0A%7B%0A%20%20%0A%20%20%20%20int%20i%20%3D%200%20%2C%20j%20%3D%200%3B%0A%20%20%0A%20%20%20%20%2F%2F%20Iterate%20a%20loop%20over%20the%0A%20%20%20%20%2F%2F%20range%20%5B0%2C%205%5D%0A%20%20%20%20%20for(int%20i%20%3D%200%20%3B%20i%20%3C%205%20%3B%20i%20%2B%2B)%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20printf(%E2%80%9Ci%20%3D%20%25d%2C%20j%20%3D%20%E2%80%9C%2C%20i)%3B%0A%20%20%0A%20%20%20%20%20%20%20%20%2F%2F%20Iterate%20a%20loop%20over%20the%0A%20%20%20%20%20%20%20%20%2F%2F%20range%20%5B0%2C%205%5D%0A%20%20%20%20%20%20%20%20for(int%20j%20%3D%200%20%3B%20j%20%3C%205%20%3B%20J%20%2B%2B)%7B%0A%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20Usage%20of%20Break%20statement%0A%20%20%20%20%20%20%20%20%20%20%20%20%20If%20(%20j%20%3D%3D%202)%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20printf(%E2%80%9C%25d%20%E2%80%9C%2C%20j)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%0A%20%20%20%20%20%20%20%20printf(%22%5Cn%22)%3B%0A%20%20%20%20%7D%0A%20%20%0A%20%20%20%20return%200%3B%0A%7D%0A%0A” message=”” highlight=”” provider=”manual”/]Output

Continue
- This statement is used to bring the control to the beginning of the loop.
- The continue statement skips some lines of code inside the loop and continues with the next iteration.
- It is mainly used in a program for skiiping certain condition.
- This statement does not exit from the loop of the body.
- It is not used to exit from the loop body.
- Continue statement is not used with switch statement.
- It can be used only with while, do while and for loop.
- When the control encounters continue statement,control automatically executes the remaining statements of the loop body.
Syntax

Sample Code
[pastacode lang=”c” manual=”%23include%20%3Cstdio.h%3E%0A%20%20%0A%2F%2F%20Driver%20Code%0Aint%20main()%0A%7B%0A%20%20%20%20%20%20Int%20i%20%3D%200%20%2C%20j%20%3D%200%20%3B%0A%20%20%0A%20%20%20%20%2F%2F%20Iterate%20the%20loop%20over%20the%20range%5B0%2C5%5D%0A%20%20%20%20for%20(int%20i%20%3D%200%3B%20i%20%3C%205%3B%20i%2B%2B)%20%7B%0A%20%20%20%20%20%20%20%20%20printf(%E2%80%9Ci%20%3D%20%25d%2C%20j%20%3D%20%E2%80%9C%2C%20i)%3B%0A%20%20%20%20%20%20%20%20%2F%2F%20Iterate%20the%20loop%20over%20the%20range%5B0%2C5%5D%0A%20%20%20%20%20%20%20%20For(int%20j%20%3D%200%3B%20j%20%3C%205%20%3B%20j%2B%2B)%7B%20%20%0A%20%20%20%20%20%20%20%20%20%2F%2F%20Usage%20of%20Continue%20Statement%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20(j%20%3D%3D%202)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20continue%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20printf(%22%25d%20%22%2C%20j)%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20printf(%E2%80%9C%5Cn%E2%80%9D)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%0A%20%20%20%20return%200%3B%0A%7D%0A%0A” message=”” highlight=”” provider=”manual”/]Output

