MCQ Practice Single Best Answer Topic: Variable in C Language

Q What would be the output of the following program?
#include  
void main()
{
   extern int i;
   i =20;
   printf("sizeof(i)");
}

Question ID
#1401
Subchapter
Variable in C Language
Action
Choose one option below

Choose Your Answer

Click an option to check whether your answer is correct.

  • A 2
  • B 4
  • C would vary from compiler to coompiler
  • D undefined reference to `i'
Correct Answer: D

Explanation

Error: undefined reference to `i'

Share This Question

Share this MCQ with your friends or study group.