C++ continue statement skip to next iteration of for loop

Description

C++ continue statement skip to next iteration of for loop

#include <iostream>

using namespace std;

int main()/*w  w  w. j  a v a 2  s  . c o m*/
{
    for (int i=0; i<10; i++)
    {
        cout << i << " ";
        if (i == 5)
        {
            cout << endl;
            continue;
        }
        cout << i * 2 << endl;
    }

    cout << "All Finished!" << endl;

    return 0;
}



PreviousNext

Related