Ticker

6/recent/ticker-posts

Print upto n numbers Program




Print numbers upto n terms -


#include <stdio.h>

int main()
{ 
  int n,i;
  printf("Enter the number ");
  scanf("%d",&n);
  while (i<=n)
  {
     printf("%d,",i);
     i++;
  }
return 0;
}

Output -

Enter the number 5
1,2,3,4,5,

Post a Comment

0 Comments