Multiple choice technology programming languages

#include main(){ extern int i; i=23; printf("%d",i); }

  1. 23

  2. Prints some address

  3. Compilation error

  4. Run time error

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

The code declares 'i' as extern but never defines it. An extern declaration tells the compiler that the variable exists elsewhere, but without a definition, the linker cannot resolve the symbol. The assignment 'i=23;' attempts to use an undefined external symbol, which causes a linkage error during compilation/linking. Every extern variable must have exactly one definition in some translation unit.