Sunday, 11 May 2014

For loop in c

For loop in c 
#include<stdio.h>             //header file stdio.h
#include<conio.h>            //header file conio.h
main()
{
int i,n;                                       //variable declaration
printf("enter the number of times for loop runs");
scanf("%d",&n);
for(i=0;i<n;i++)                       //for loop  
{
printf("the for loop run %d time",i);
}
getch();
}                                          //end of the program

No comments:

Post a Comment