RVBTCC/test/operator/binary.c

16 lines
471 B
C
Raw Permalink Normal View History

2024-12-07 06:13:34 +00:00
int printf(char* format, ...);
int main() {
2024-12-24 03:31:50 +00:00
int a = 5;
int b = 4;
2024-12-08 03:40:47 +00:00
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);
2024-12-07 06:13:34 +00:00
}