Ad Code

Responsive Advertisement

1144 - Logical Sequence

Author: Ismail Hosen

Daffodil International University





Problem Link

//Please follow from main function



#include<stdio.h>


cube(int x){


    x=x*x*x;


    return x;


}


square(int x){


    x=x*x;


    return x;


}


int main()


{


    int i, n, x,y;


    scanf("%d", &n);


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


    {


        x=square(i);


        y=cube(i);


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


        printf("%d %d %d\n", i, x+1, y+1);


    }


    return 0;


}





Post a Comment

0 Comments