engineering computer science MCQ #2150

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

engineering computer science MCQ #2150

  1. Question 1

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

    • A) 1
    • B) 4
    • C) 2
    • D) Error

    Answer: 4

    Explanation: In C, the size of a character literal is equal to the size of an int, typically 4 bytes.