ProgrammingModerate
printf("%x %o", 255, 8); What is printed?
- A. FF 8
- B. 255 8
- C. ff 9
- D. ff 10
Correct answer: D. ff 10
255 is ff in hexadecimal and 8 is 10 in octal, printed with lowercase digits.
More C Programming questions
- char s[5] = "abcd"; printf("%s", s + 2); What is printed?
- char buf[4]; int n = snprintf(buf, sizeof buf, "%c%c%c%c", 'w', 'x', 'y', 'z'); printf("%d %s", n, buf); What is printed?
- char names[] = {"ab", "cde"}; printf("%zu", sizeof names / sizeof names[0]); What is printed?
- for (char c = 'a'; c <= 'e'; c += 2) putchar(c); What is printed?
- char cnt[26] = {0}; cnt['c' - 'a']++; printf("%d", (int)('c' - 'a')); What is printed?
- printf("%s", (char[]){'h', 'i', '0'}); What is printed?