c++ Program To Understand While Loop

      No Comments on c++ Program To Understand While Loop

A while loop statement executes a code until the given condition is true.

Syntax:-
while(condition){
   statement(s);
}
Example:-
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int i=1;
while(i<=10)
{
 cout<<"Value of i = "<<i<<endl;
 i++;
}
getch();
}

OUTPUT:-

scanfcode

Leave a Reply

Your email address will not be published. Required fields are marked *