Tuesday 9 December 2014

C Program to examine loops concept

Program to examine loops concept
#include<stdio.h>
#include<stdlib.h>
main()
{
int i=0,n;
printf("enter value for n\n");
scanf("%d",&n);
for(;;)
{
do
{
printf("%d\t",i);
i++;
}while(i<n);
break;
}
}
OutPut:
enter value for n
5
0 1 2 3 4