C语言基础:求模和取余演示
#include <stdio.h> int main () { int remainder; int result; result = 10 / 3; remainder = 10 % 3; printf("10 Divided by 3 is %d Remainder %d\n", result, remainder); return 1; }
gcc编译输出
10 Divided by 3 is 3 Remainder 1
C语言基础:求模和取余演示
#include <stdio.h> int main () { int remainder; int result; result = 10 / 3; remainder = 10 % 3; printf("10 Divided by 3 is %d Remainder %d\n", result, remainder); return 1; }
gcc编译输出
10 Divided by 3 is 3 Remainder 1