Menu Close

First Three powers of N number…. [Cprogm] FcukTheCode

Flipkart announced the year end stock clearance sale and as apart of they have also conducting the contest and the users answering the questions asked in the contest can win Moto One Power free of cost.

The task is to display the first three powers (N^1, N^2, N^3) of the given.

Nishanth was looking to buy Moto One Power. 
If you help nishanth in solving the task he will get his favorite mobile.Can you help him?

Input:
Only line of the input has a single integer representing N.

Output:
Print the first three powers of N
#include <stdio.h>
#include <math.h>
int main()
{
int N,fp,sp,tp;
scanf("%d",&N);
fp=pow(N,1);
sp=pow(N,2);
tp=pow(N,3);
printf("%d %d %d",fp,sp,tp);
    return 0;
}

INPUT_1:
137

OUTPUT:
 137  18769  2571353


 


INPUT_2:
 89

OUTPUT:
89  7921  704969


INPUT_3:
 98

OUTPUT:
98  9604  941192