Friday, 2 April 2021

while, do-while in c++

 

#include<iostream.h>

#include<conio.h>

#include<stdio.h>

int main()

{

clrscr();

int i=0;

while(i<3)

i++;

cout<<"Hello\n"<<i<<endl;


i=2;

do

{

cout<<"Hi";

}

while(i<2);

cout<<endl;

i=0;

while(++i)

{

cout<<"Delhi"<<i<<endl;

break;

}


cout<<endl;

i=0;

do

{

cout<<"Hello"<<endl;

}

while(i!=0);

getch();

return 0;

}

No comments:

Post a Comment