搜尋此網誌

2025年7月15日星期二

If statements in C++

No "then" keyword

In C++, the percent symbol % is used as the modulus operator. It calculates the remainder after dividing one integer by another.

In C++, == is the equality operator. It checks whether two values are equal and returns true if they are, and false otherwise.

In C++, bool is a built-in type used to represent Boolean values—essentially, values that are either true or false.

1: true

0: false

In C++, != is the inequality operator. It checks whether two values are not equal. If they are different, it returns true; if they’re the same, it returns false.

In C++, && is the logical AND operator, used to combine two Boolean expressions. It returns true only if both expressions are true—otherwise, it returns false.

affirmative: (also positive) (of a statement) expressing something that is true, did happen, etc.; not containing words such as ‘no’, ‘not’, ‘never’, etc.

subtle: not very obvious or easy to notice

Microsoft Copilot

沒有留言:

發佈留言