The integer division symbol in C language is the "/" symbol. What should be noted with the integer division operator (/) is that the operation result will be automatically converted to the same data type as the dividend.
In C language, integer division is the / symbol, and the % symbol is the remainder operator.
What you need to note about the integer division operator (/) is that the operation result will be automatically converted to the same data type as the dividend.
Examples are as follows:
int a=5, b=2; float c; c = a/b; // 运算结果为2.0,而不是2.5,因为a是int型的,所以计算结果会转换为int型, // 而c又是float型的,所以最后将整型的2转换为float型。
Recommended tutorial: "C Language"
The above is the detailed content of What is the integer division symbol in C language?. For more information, please follow other related articles on the PHP Chinese website!