funkcja zasilania bloków kodu nie działa w c
używam bloku kodu do nauki c. mój kod jest
#include<stdio.h>
#include<math.h>
int main()
{
int x;
x = pow(5,2);
printf("%d", x);
}
Output is 25
Kiedy używam tego kodu
#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
co tu jest nie tak? Po prostu biorę wartość za pomocą funkcji skanowania, a także wykorzystuję funkcję pow w ten sam sposób.