C++ Tutorial





Español Français 中文 Deutsch Portuguese Japanese nederlands
   
 
C++ Tutorial
C++ Language Tutorial - Object Oriented Programing - OOPs History of C++
C++ Language Tutorial - Object Oriented Programing - OOPs Structure of C++
C++ Language Tutorial - Object Oriented Programing - OOPs C++ Datatypes
C++ Language Tutorial - Object Oriented Programing - OOPs Variables
C++ Language Tutorial - Object Oriented Programing - OOPs Constants
C++ Language Tutorial - Object Oriented Programing - OOPs Operators
C++ Language Tutorial - Object Oriented Programing - OOPs Control Structures
C++ Language Tutorial - Object Oriented Programing - OOPs Arrays
C++ Language Tutorial - Object Oriented Programing - OOPs Functions
C++ Language Tutorial - Object Oriented Programing - OOPs Class
C++ Language Tutorial - Object Oriented Programing - OOPs Predefined Functions
C++ Language Tutorial - Object Oriented Programing - OOPs I/O Functions
C++ Language Tutorial - Object Oriented Programing - OOPs String, Character Functions
C++ Language Tutorial - Object Oriented Programing - OOPs Mathematical Functions
C++ Language Tutorial - Object Oriented Programing - OOPs Time Date Functions
C++ Language Tutorial - Object Oriented Programing - OOPs Dynamic Allocation
C++ Language Tutorial - Object Oriented Programing - OOPs Utility Functions
C++ Language Tutorial - Object Oriented Programing - OOPs OOP's Concept
C++ Language Tutorial - Object Oriented Programing - OOPs Special Topics
C++ Language Tutorial - Object Oriented Programing - OOPs Type casting
C++ Language Tutorial - Object Oriented Programing - OOPs Feedback
C++ Language Tutorial - Object Oriented Programing - OOPs Ask Your Doubts
 





Continue Statement - C++ Control Structures


Tutorials Cpp

Topic

Using Continue Statement in C++?

How to skip current iteration of a loop?


Explanation

Continue statement is used to skip the code after the "continue" and go ahead with the next iteration of a loop.

Difference between "break" and "continue":

The "break" statement terminates the current statement, but a "continue" statement terminates the current iteration of a loop by not executing statements after it.

Syntax:
   continue;
Example:

  #include <iostream.h>
  void main()
   {
    int i;
    cout  << "Enter a integer::" << '\n';
    cin >> i;
    while(i >0)  
     {
         cout << "Value of  i is::" <<  i  <

Result:
   Enter a Integer::3
   Value of i is:: 3
   SKIPPED
   Value of i is:: 1
   Not skipped
   Exited Loop
   

In the above example only when the value of i is 2 the "cout" statement with message "skipped" is executed, and the "cout" statement with the message is skipped.








Note
C++ is one of the most used programming languages in the world. Also known as "C with Classes". Hope you enjoy this tutorial. Do send your feedback or suggestions on this C++ tutorial. This is a copyright content.

Other Links

web hosting