Input
The input file contains an integer N.
Output
Print the output according to the given example.
Input Sample | Output Sample |
5
|
1 1 1
2 4 8 3 9 27 4 16 64 5 25 125 |
Solution using C :
#include <stdio.h>
int main() {
int n,i;
scanf("%d",&n);
for(i=1; i<=n; i++)
{
printf("%d %d %d\n",i,i*i,i*i*i);
}
return 0;
}
int main() {
int n,i;
scanf("%d",&n);
for(i=1; i<=n; i++)
{
printf("%d %d %d\n",i,i*i,i*i*i);
}
return 0;
}
Comments
Post a Comment