Home > Back-end >  Why isn't obtained the maximum, it is always a value?
Why isn't obtained the maximum, it is always a value?

Time:10-11

//for the two integers supplied
#include
Int main ()
{
int a,b;
Printf (" please input two integers: \ n ");
The scanf (" % d % d ", & amp; A, & amp; b);
If (aPrintf (" maximum number is: % d \ n ", a);
return 0;
}
    

CodePudding user response:

"% d % d"

CodePudding user response:

Because there is no access to the value of your b.

the scanf (" % d % d ", & amp; A, & amp; b);
To:
 the scanf (" % d % d ", & amp; A, & amp; b); 

Can.

CodePudding user response:

Thank you

CodePudding user response:

#include
Int main ()
{
int a,b;
Printf (" please input two integers: \ n ");
The scanf (" % d, % d ", & amp; A, & amp; b);
If (aPrintf (" maximum number is: % d \ n ", a);
return 0;
}

CodePudding user response:

Ha ha, small problem attracted a lot of great spirit, onlookers
  • Related