Friday, October 26, 2018

Uri 1146 solution in C | Growing Sequences

/*Before seeing the code solution make sure that you have tried enough. Don’t copy- paste the whole code. Find out the logic. If you face any trouble, just inform me in comment.*/

#include<stdio.h>
main()
{
    int x,i;
    while(1)
    {
        scanf("%d",&x);
         if(x==0)
            break;
        for(i=1;i<x;i++)
        {
            printf("%d ",i);
        }
        printf("%d\n",x);

    }
    return 0;
}

 //Happy_Coding

No comments:

Post a Comment