Use do...while loop to count value - C++ Statement

C++ examples for Statement:do while

Description

Use do...while loop to count value

Demo Code

#include <iostream>

using namespace std;

int main()/*w w w .j  av  a  2 s. c  o m*/
{
    int i = 0;

    do
    {
        cout << i << endl;
        i++;
    }
    while (i <= 10);

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

    return 0;
}

Result


Related Tutorials