Home > Back-end >  Why is enter any number results are 0?
Why is enter any number results are 0?

Time:09-18

# include & lt; stdio.h>
Void main ()
{
Double x, y;
The scanf (" % 1 f ", & amp; X);
If (x<0)
Y=0;
Else if (x<10)
Y=x;
Else if (x<20)
Y=10;
The else
Y=0.5 * x + 20;
Printf (" y=%. Lf \ n ", y);
}

CodePudding user response:

The scanf (" % ld ", & amp; X); Is l (love lu), not 1 (one)

CodePudding user response:

Printf, just on the other hand, is not love lu
  • Related