ProgrammingModerate
printf("%d", 'a' < 'b' && 'b' < 'c'); What is printed?
- A. 0
- B. 2
- C. 3
- D. 1
Correct answer: D. 1
Both comparisons are true because the character codes increase, so the result is 1.
More C Programming questions
- printf("%d %d", 5 / 2, -5 / 2); What is printed in C99?
- What is printed? c #include <stdint.h> #include <stdio.h> int main(void) { uint32t v = 0x00F0F0A5u; v = v - ((v >> 1) & 0x55555555u); v =…
- What is printed? c #include <stdio.h> #include <string.h> #include <stdlib.h> int cmp(const void a, const void b) { const char x = (const…
- What is printed? c #include <stdio.h> int main(void) { int m[2][3] = {{1, 2, 3}, {4, 5, 6}}, t[3][2]; for (int i = 0; i < 2; i++) for (int…
- What is printed? c #include <stdio.h> int calls = 0; unsigned g(unsigned a, unsigned b) { calls++; return b == 0 ? a : g(b, a % b); } int…
- What is printed? Assume unsigned int is 32 bits and unsigned long long is 64 bits. c #include <stdio.h> unsigned long long pw(unsigned b…