do while:
if we are using do while loop,body of loop is executed atleast once time even the conditon is false
for example:
/*************<soeasyprograms.blogspot.in>************/
#include<iostream.h>
#include<conio.h>
// Program using do while loop
int main()
{
int x;
clrscr();
x = 0;
do {
// "Hello, world!" is printed at least one time
// even though the condition is false
cout<<"Hello, world!\n";
} while ( x != 0 );
}
/*************<soeasyprograms.blogspot.in>************/
if we are using do while loop,body of loop is executed atleast once time even the conditon is false
for example:
/*************<soeasyprograms.blogspot.in>************/
#include<iostream.h>
#include<conio.h>
// Program using do while loop
int main()
{
int x;
clrscr();
x = 0;
do {
// "Hello, world!" is printed at least one time
// even though the condition is false
cout<<"Hello, world!\n";
} while ( x != 0 );
}
/*************<soeasyprograms.blogspot.in>************/
No comments:
Post a Comment