C language% plastic
In C language,% can only be used as an integer operator, and% is a remainder operator, which can only be used for integer and integer operations. If it is used for non-integer operation, the program will report an error and cannot run.

Option A is wrong, because in C language, sentences are separated by semicolons in English, that is, ";" , not a colon.

The d option is correct, because% is a division and remainder operation, which is suitable for integer and integer operations. Otherwise, different compilers will get different results. As binocular operators, the left and right operands can be numeric values or expressions, but the left and right operands must be integers.

Extended data

The remainder operator "%",a binary operator, is left associative. The quantities involved in the operation are all integers. The result of the remainder operation is equal to the remainder after dividing two numbers. The "%"modular operator has some small applications, such as:

1. When you want to get a random number through rand (), rand ()%100; Generate a random number of 0-99.

If you want to generate a number between 16-59, you can write it like this: rand()%44+ 16 (where 44 is obtained from 59- 16+ 1).

Rand()%44 can get a random number of 0-43, and add 16 to get a random number of 16-59;

2. The "%"operation is also commonly used for N-ary conversion.

If it is binary conversion, the converted binary number can be obtained by combining/with% (actually short division). When the original number is divided by the remaining 0, the last modulus of the original number is the highest decimal.

Baidu encyclopedia-operator