-1
#include <stdio.h>
#include<math.h>
int main() {
double pi = 3.14159;
double R, A;
scanf("%lf", &R);
A = (pi)* pow(double R, int 2);
printf("%lf\n", A);
return 0;
}
This code is returning the error: Too few Arguments to Function 'Pow' why?
-1
#include <stdio.h>
#include<math.h>
int main() {
double pi = 3.14159;
double R, A;
scanf("%lf", &R);
A = (pi)* pow(double R, int 2);
printf("%lf\n", A);
return 0;
}
This code is returning the error: Too few Arguments to Function 'Pow' why?
1
Try calling the function as follows:
A = pi * pow(R, 2);
and see if the error persists.
The parentheses in pi is not necessary (but also does not cause error), the error was because you were invoking the function with the data types, which is not accurate
Or rather, replace pow(R, 2) for R * R.
If the power is fixed, and a low value as is the case, it is better to make it easier as @Victorstafusa mentioned, unless it is clear that it is a job that requires you to use the Pow function or the power is variable or unknown...
Problem solved, thanks! I wanted to use the function Pow to fix even... sometimes I forget that it exists, I’m beginner.
Browser other questions tagged c mathematics
You are not signed in. Login or sign up in order to post.
By the way: Math. h already defines pi:
M_PI * pow(R,2)– JJoao