While loop is used to execute a specific part of program till condition satisfies.Now it will hard to understand but by syntax and example you can easily understand so let us see syntax.
Syntax:
while(condition)
{
Statements;
}
Example program for While loop:
#include<stdio.h>
#include<conio.h>
main()
{
int a=1; //Defining value of integer is most important clrscr();
while(a<=10)
{
printf("%d\n",a);
a++; //This step is Most Important step in while loop }
getch();
}
#include<conio.h>
main()
{
int a=1; //Defining value of integer is most important clrscr();
while(a<=10)
{
printf("%d\n",a);
a++; //This step is Most Important step in while loop }
getch();
}