engineering computer science MCQ #2116

What is the output of `printf('%d', sizeof('a'));` in C?

engineering computer science MCQ #2116

  1. Question 1

    Q1. What is the output of `printf('%d', sizeof('a'));` in C?

    • A) 1
    • B) 2
    • C) 4
    • D) sizeof(char)

    Answer: 4

    Explanation: In C, character literals are treated as integers, so 'a' is an int, typically 4 bytes on most systems.