RVBTCC/test/operator/binary.c
2024-12-24 16:16:03 +08:00

16 lines
471 B
C

int printf(char* format, ...);
int main() {
int a = 5;
int b = 4;
printf("%d+%d=%d\n", a, b, a + b);
printf("%d-%d=%d\n", a, b, a - b);
printf("%d*%d=%d\n", a, b, a * b);
printf("%d/%d=%d\n", a, b, a / b);
printf("%d%%%d=%d\n", a, b, a % b);
printf("%d&%d=%d\n", a, b, a & b);
printf("%d|%d=%d\n", a, b, a | b);
printf("%d^%d=%d\n", a, b, a ^ b);
printf("%d<<%d=%d\n", a, b, a << b);
printf("%d>>%d=%d\n", a, b, a >> b);
}