Get two numbers n and m, and then calculate the nth power of m.
Input specification
There will be two numbers in the input file which are between 1 < n, m ≤ 9.
Output specification
Calculate and show the result followed by an endline.
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{
int m,n,sum;
scanf("%d %d",&m,&n);
sum=pow(n,m);
printf("%d",sum);
The problem description refers to 'numbers'. It doesn't say whether they are integer or floating point types. Do you know what the actual input numbers will be?
The description also says, "show the result followed by an endline". The newline is missing in the above code.