Friday, October 26, 2018

Uri 1143 solution in C | Squared and Cubic

/*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 i,j,k,n;
    scanf("%d",&n);
    for(i=1;i<=n;i++)
    {
       j=i*i;
       k=i*i*i;
       printf("%d %d %d\n",i,j,k);
    }
    return 0;
}


 //Happy_Coding

No comments:

Post a Comment