Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

do while c++

// Do while loop
// C++ Program to print numbers from 1 to 5

#include <iostream>

using namespace std;

int main() {
    int i = 6; 

    // while loop from 1 to 5
    while (i <= 5) {
        cout << i << endl;
        i++;
    }
    
    return 0;
}
Source by beginnersbook.com #
 
PREVIOUS NEXT
Tagged:
ADD COMMENT
Topic
Name
1+7 =