Ad Code

Responsive Advertisement

1145 - Logical Sequence 2

Author: Ismail Hosen

Daffodil International University





Problem Link

//Please follow from main function

#include<stdio.h>

int main()

{

    int i,x,y,n,count=0;

    scanf("%d %d", &x, &y);

    for(i=1; i<=y; i++)

    {



        count++;

        if(x==count){

            printf("%d\n",i);

            count=0;

        }

        else

            printf("%d ", i);

    }

    return 0;

}

Post a Comment

0 Comments