ProgrammingModerate
printf("%d", (int)'A' + '\x01'); What is printed?
- A. 65
- B. 67
- C. 66
- D. 98
Correct answer: C. 66
'A' is 65 and '\x01' is 1, and the addition is performed on ints, giving 66.
More C Programming questions
- for (char c = 'z'; c > 'w'; c--) putchar(c); What is printed?
- printf("%d", sizeof(void ) == sizeof(int )); What is printed?
- int a[3]; int p = a; printf("%d", p + 3 > a); What is printed?
- struct { int x; int y; } p = {.y = 2, .x = 1}; printf("%d", p.x + p.y); What is printed?
- long long x = 1LL << 40 >> 39; printf("%lld", x); What is printed?
- int a, b, c; a = b = c = 5; printf("%d", a + b + c); What is printed?