Die Power-Funktion der Codeblöcke funktioniert in c nicht
Ich benutze Codeblock zum Lernen c. Mein Code ist
#include<stdio.h>
#include<math.h>
int main()
{
int x;
x = pow(5,2);
printf("%d", x);
}
Output is 25
Wenn ich diesen Code benutze
#include<stdio.h>
#include<math.h>
int main()
{
int x,i,j;
printf("please enter first value");
scanf("%d", &i);//5
printf("please enter second value");//2
scanf("%d", &j);
x = pow(i,j);
printf("%d", x);
}
Output is 24
was ist hier falsch? Ich nehme nur Wert mit Scan-Funktion und auch mit Pow-Funktion in gleicher Weise.