Professional Documents
Culture Documents
Syntax
The syntax of while loop is as follows:
While(condition)
{
statement 1;
statement 2;
:
:
Statement N;
}
Flowchart
The flowchart of while loop is as follows:
#include<iostream>
using namespace std;
int main()
{
int n;
n=1;
while(n<=10)
{
cout<<n<<endl;
n++;
}
getch();
}
How above Program Works?