/*
关系运算符:比较两个数活着表达式之间的关系
>
==
<
!=
>=
<=
int a =3,b = 2;
a > b;
返回值:
1) 真 1
2) 假 0
*/
#include <stdio.h>
int main(int argc, const char * argv[]) {
int a =3,b = 2,result = -1;
//把a > b的值赋值给result
// 3 2
result = a > b; //1
result = a < b; //0
result = a >= 3; //1
result = a <= 3; //1
result = a == 3; //1
result = a == b; //0
result = a != b; //1
printf("result = %d\n",result);
return 0;
}
|
|