Home > Back-end > Which master to help give directions under the C language code
Which master to help give directions under the C language code
Time:09-20
why I every time no matter what type the following code digital press enter only perform printf (" BBBBB \ n ") this one line of code? Over and can't find where is wrong, a great god answers, appreciate ~!!
[/size]
#include #include
Int main (void) { Double delta;
Printf (" please input the value of the delta, delta=", delta); The scanf (" % d ", & amp; The delta);
If (delta & gt; 2)
Printf (" AAAAA \ n ");
Else if (delta & lt;=2 & amp; & The delta & gt; 0)
Printf (" BBBBB \ n ");
Else if (delta==0)
Printf (" CCCCC \ n "); The else
Printf (" DDDDD \ n ");
return 0; }
CodePudding user response:
Later I found that if I put the delta data types defined by float can run properly, but if defined as double operation error, don't know what's the problem??
CodePudding user response:
The scanf (" % d ", & amp; The delta); % d is the input integer