Home > Back-end >  Save the children!
Save the children!

Time:10-16

Why the input value can't get the result?
#include
#include
The main ()
{
Double rate, capital, deposit;
int n;
Printf (" do enter rate, year, capital: \ n ");
The scanf (" % lf, % d, % lf ", & amp; Rate, & amp; N, & amp; Capital);
Deposit=capital * pow (1 + rate, n);
Printf (" deposit=% 3 f \ n ", deposit).
return 0;
}

CodePudding user response:

The scanf (" % lf, % d, % lf ", & amp; Rate, & amp; N, & amp; Capital);
You are required to enter 0.00225, 10100 0
When the input in the middle of the comma cannot be omitted

CodePudding user response:

Either enter 0.00225, 10100 0
Either change the scanf (" % lf, % d, % lf ", & amp; Rate, & amp; N, & amp; Capital); Lf the scanf (" % % d % lf ", & amp; Rate, & amp; N, & amp; Capital);

CodePudding user response:

Fun
reference 1 floor response:
the scanf (" % lf, % d, % lf ", & amp; Rate, & amp; N, & amp; Capital);
You are required to enter 0.00225, 10100 0
When the input in the middle of the comma can't omit

Thanks brother I know
  • Related