Pages

How to print 6 numbers in for loop

//How to print 6 numbers in for loop.


#include<stdio.h>
#include<conio.h>

void main() {
  int i=0;
  clrscr();
  printf("Example of for loop:\n");
 
  for(i=0;i<=5;i++)
  {
   printf("%d\n",i);
  }
  getch();
}

Output:

Example of for loop:
0
1
2
3
4
5

No comments:

Post a Comment