Friday, 9 May 2014

C SIMPLE PROGRAM USING WHILE LOOP

C SIMPLE PROGRAM USING WHILE LOOP

#include<stdio.h>              //header file stdio.h
#include<conio.h>            //header file conio.h
main()                                // main function
{                                          //start of the program
int a=0;                                //variable declaration
clrscr();      //clrscr function use to clears the previous output screen
while(a< 9)//while loop runs until condition is satisfied
{                       //start of the while loop block
printf("while loop runs");
a++;                      //increment the variable a
}                           //end of the while loop block
printf("while loop stop");
getch();
}             //end of the program

Your feed back and comments are welcomed and appreciated!!

No comments:

Post a Comment