Advertisement
PROFESSOR_AIH

Growing Sequences

Apr 7th, 2022
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.34 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4.     int x,i;
  5.     while(1)
  6.     {
  7.         scanf("%d",&x);
  8.         if(x!=0)
  9.         {
  10.             printf("1");
  11.             for(i=2; i<=x; i++)
  12.             {
  13.                 printf(" %d",i);
  14.             }
  15.  
  16.             printf("\n");
  17.         }
  18.         else
  19.             break;
  20.  
  21.     }
  22.  
  23.     return 0;
  24. }
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement