I'm stuck on a question in my assignment that's asking me to create a program to calculate the Area-cubed of a cylinder knowing that
Pi = 3.14159 and Radius = 2.2
the formula is 4/3 Pi R^3
and this is the code I have written down:
Code:
#include<stdio.h.>
#include<math.h>
main()
{
float Pi = 3.14159, num1 = pow(2.2,3), area;
area = 4 / 3 * num1;
printf("%f", area);
getch();
}
I'm getting different answers if I instead make the 4 / 3 into 1.25, so I was wondering how do I signify the operations in the order it should be in, if it should be according to PEMDAS(which i believe it should be)?
Thanks in Advance!