Home > Back-end >  For help, you please look at the great god, where is my program is wrong?
For help, you please look at the great god, where is my program is wrong?

Time:09-18

C program is as follows:
#include
Void main ()
{
Float r1=0.0036, r2=0.0225)=0.0198 r3, p1, p2, p3;
Float p0.
The scanf (" % f, & amp; P0 ");
P1=p0 * (1 + r1);
The p2=p0 * (1 + r2);
P3=p0 * (1 + r3);
Printf (" p1=\ np2=% f, % f \ n \ np3=% f ", p1, p2, p3);

}
Input P0=1000.0;
All the results is 0,
Program error somewhere, give advice or comments please the great god, thank you

CodePudding user response:

The scanf (" % f, & amp; P0 "); Write wrong, quotes in front is a comma

CodePudding user response:

 the scanf (" % f, & amp; P0 "); 

Change
 the scanf (" % f ", & amp; P0); 

CodePudding user response:

The meaning of the parameters for the scanf () function, please refer to the "c + + printf () function USES 10 to 1" wish I could help you!

CodePudding user response:

P0 input a lonely
  • Related