CP CVDT Q23

  • Option : B
  • Explanation : The declaration extern int a; inside main refers to the file-scope variable defined later as int a = 20;. Because a has static storage duration and is initialized to 20, printf prints 20. Therefore, the intended answer is B (20), assuming older C syntax that permits an implicit int return type for main. In modern C, the function should be declared int main(void).
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *