Do...while repetition statement - C++ Statement

C++ examples for Statement:do while

Description

Do...while repetition statement

Demo Code

#include <iostream>

int main(int argc, const char *argv[]) {
    int counter = 1;

    do {/*w  ww .  j  a  v a  2 s  .c  om*/
        std::cout << counter << " ";
        ++counter;
    } while (counter <= 10);

    std::cout << std::endl;
    return 0;
}

Result


Related Tutorials