Multiple choice

What will be the output of the following function?

#define int char main() { int i=65; printf(%d,sizeof(i)); }

  1. 1

  2. 2

  3. Error

  4. None of these

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The preprocessor replaces the keyword 'int' with 'char' throughout the code. Thus, the variable 'i' is actually a char, and sizeof(i) returns 1, the size of a character in C.