3. Comparison and logical operations

/*
Comparison operators:
1.> >= < <=
2.== !=

Usually, the judgment statement is used in the judgment statement, and the judgment statement appears in the if parentheses, as well as the loop parentheses.

Logical operators:
1. ! Not true is false!1 !5 !-1 !(9>8) Not false is true!0 !(8>9)
2.&& 0&&0=0 0&&1=0 1&&0=0 1&&1=1 As long as one side is false is false, both sides are true
3.|| 0||0=0 0||1=1 1||0=1 1||1=1 As long as one side is true, it is true, and both sides are false is false
*/
#include "stdio.h"
void main()
{
int n=2;
if(10>9||(n=10))
printf("%d#",n);
else
printf("%d *",n);
}

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325892418&siteId=291194637