Home > Back-end >  C language for beginners if else than size
C language for beginners if else than size

Time:06-10

#include
Int main ()
{
Char a;
Char b;
Printf (" please input the number which you want to compare with a space for the intermittent: \ n ");
The scanf (" % % c, c, & amp; A, & amp; B);

If (a> B) {printf (" a greater than b \ n ");
} else {printf (" a less than b \ n "); }
return 0;

}

CodePudding user response:

Tip is separated by a space inside, the following code is a comma, what can I do?

CodePudding user response:

 the scanf (" % c % c ", & amp; A, & amp; B); 

According to your reminder, you should get rid of a comma here

CodePudding user response:

The scanf likely to fail, when the input format wrong
Determine its return value, and asked to input,

CodePudding user response:

Okay, I if the else don't thank

CodePudding user response:

reference 2 building self-confidence boy reply:
 the scanf (" % c % c ", & amp; A, & amp; B); 

According to your reminder, should remove the comma here

Okay, I if the else don't thank

CodePudding user response:


I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10581430.html
I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10768339.html
  • Related