Home  >  Article  >  What is the operator in C language whose operand must be an integer?

What is the operator in C language whose operand must be an integer?

(*-*)浩
(*-*)浩Original
2019-12-23 10:17:0565170browse

What is the operator in C language whose operand must be an integer?

In C language, the operand of modular operation (ie remainder operation %) must be integer data (constant, variable or expression).

Modular operation is what is called remainder in mathematics. This operation must require the operands to be integers. (Recommended Learning: PHPSTORM )

This specific reason is:

1, the calculation of the remaining is the operation in integer division. The remainder is the undivided portion of the dividend in integer division. For example, if 23 is divided by 5, the quotient is 4 and the remainder is 3.

2. Bit operations must be of integer type because bit operations operate on bits in integers. As shown in the picture:

What is the operator in C language whose operand must be an integer?

The above is the detailed content of What is the operator in C language whose operand must be an integer?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn