Programing C

I wrote the following "program"

#include <stdio.h>
#include <math.h>

int main()
{
double x,y;

printf("enter a number");
scanf("%FL,&x_one");

y = pow(x,3.0) - 4.0*x + 1.0;
printf("%d",y);

return 0;

}

could anyone tell me why I can't get a correct result from this?
What had I done wrong with the pow(power) operation?
THANX!
 PhysOrg.com science news on PhysOrg.com >> City-life changes blackbird personalities, study shows>> Origins of 'The Hoff' crab revealed (w/ Video)>> Older males make better fathers: Mature male beetles work harder, care less about female infidelity
 Recognitions: Gold Member Science Advisor Staff Emeritus The line scanf("%FL,&x_one"); doesn't make any sense. Did you put the quote marks in the wrong place? Did you mean: scanf("%FL", &x_one); Of course, the variable x_one doesn't exist in your program, and you probably should use lowercase characters in your scanf -- like "%fl". - Warren
 even I corrected the errors you pointed out to me... i can't get any other result but the degit "0"! I use miracle C to compile it. corrected program: #include #include int main() { double x,y; printf("enter a number"); scanf("%fl",&x); y = pow(x,3.0) - 4.0*x + 1.0; printf("%d",y); return 0; } I think the "pow" function is not being recognized... whatever vulue I enter in the parathesis after pow function, it returns 1!

Programing C

Is %fl allowed in C at all? I know %f is.
 my text book said yes, its a must in a scanf() thing the thing is the program works fine when its y = x*3.0) - 4.0*x + 1.0 or y = x-3.0 - 4.0*x + 1.0 or whatever other thing I tried just not pow(x,3.0)
 Recognitions: Gold Member Science Advisor Staff Emeritus I thought it was %lf, not %fl. Anyways, did you remember to link your program with the math library, when you compiled it?
 If you change your scanf and your printf statements to this Code: ... scanf("%lf",&x); ... printf("%lf", y); ... it should work (I tried it, and it works fine)

 Similar discussions for: Programing C Thread Forum Replies Programming & Comp Sci 5 Programming & Comp Sci 1 Academic Guidance 8 Math & Science Software 2