DO WHILE LOOP IN C++

 SYNTAX 

do{

          loop body ( c++ statement\code);

} while(condition);


//DO WHILE LOOP IN C++
#include <iostream>
using namespace std;

int main()
{
cout<<endl;

     cout<<"___ DO WHILE LOOP IN C++___";
    cout<<endl;

cout<<":SYNTAX for DO WHILE LOOP IN C++."<<endl;
 cout<<endl;

 /*

 do
{    c++ statement;

} while(condition)

 */

cout<<"do\n{    c++ statement;\n \n} while(condition)";
cout<<endl;
cout<<endl;

int i = 1;

do{
    cout<<i<<endl;
    i++;

} while(i<=30);

return 0;
}

//OUTPUT
// ___ DO WHILE LOOP IN C++___
// :SYNTAX for DO WHILE LOOP IN C++.

// do
// {    c++ statement;

// } while(condition)

// 1
// 2
// 3
// 4
// 5
// 6
// 7
// 8
// 9
// 10
// 11
// 12
// 13
// 14
// 15
// 16
// 17
// 18
// 19
// 20
// 21
// 22
// 23
// 24
// 25
// 26
// 27
// 28
// 29
// 30

Comments