LOOP | DO WHILE LOOP

 

LEC : 8

LOOP | DO WHILE LOOP


Source code:

/* DO WHILE :-

    A do...while loop is similar to a while loop, except that a do...while loop

    is guaranteed to execute at least one time.

SYNTAX :-

do {

   statement(s);

}

while( condition );

*/

#include<iostream>

using namespace std;

int main()

{

    int n;

    cout<<"Enter the number";

    cin>>n;

    do{

         cout<<endl<<n;

        n++;

    }

    while(n<10);


    return 0;

}

Comments

Popular posts from this blog

RunwayWithCode

web development Lectures

C++ Lectures