搜尋此網誌

2025年2月20日星期四

CPP

The equal-to operator (==) returns true if both operands have the same value; otherwise false.

The not-equal-to operator (!=) returns true if the operands don't have the same value; otherwise false.

operand: the number on which an operation is to be done

A Boolean expression returns a boolean value, which is either 1 (true) or 0 (false). This is useful for building logic and finding answers.

We use the ternary operator in C to run one code when the condition is true and another code when the condition is false. For example, (age >= 18) ? printf("Can Vote") : printf("Cannot Vote");

沒有留言:

發佈留言