elibraryportal Logo

Continue and GOTO Statement in C++

The continue statement is used to continue the loop with the next iteration. In other word continue statements skips any remaining statements inthe current iteration & immediately passes the control to the next iteration.

Example:-

Output:

0
1
2
4
5
6
7
8
9

Goto statement

The goto statement is also known as jump statement. It is used to transfer control to the other part of the program.

Example:-

Output:

You are not eligible to vote!
Enter your age:
15
You are not eligible to vote!
Enter your age:
18
You are eligible to vote!  
Next TopicArray in C++