I have the following block of code. The final line is meant to yield the values for X
,Y
and P
values that are input by the user. However it only returns
(0,0,0)
instead of the values given by user. What am I missing?
printf("What is the robot's initial X position? (cm)
");
scanf("%f",&X);
printf("What is the robot's initial Y position? (cm)
");
scanf("%f",&Y);
printf("What is the robot's initial angular position? (degrees)
");
scanf("%f",&P);
printf("The initial position is (%d, %d, %d)
", X,Y,P);
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…