aliensbrain
  • Home
  • Study
  • Quizzes
  • 🎤AI Practicefree
  • Notebooks
  • Community
  • Sign in
  • C Programs (GATE)
  • Find the output of the following C program: main(){extern...
Multiple choice

Find the output of the following C program:

main(){extern int a;printf(%d, a);}int a =20;

  1. 0

  2. 20

  3. Error

  4. Garbage value

  5. None of these

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

Extern int a automatically initialises to 0; so the correct answer is 0.

Keep practicing — related questions

  • Find the output of the following C program: main(){extern int i;i=20;printf(%d,sizeof(i));}
  • What will be the output of the following question? main() { extern int out; printf(“%d”,out); } int out=100;
  • Find out the output of the given program or error if any. static int i=10; i=20; int main() { printf(%d,i);...
  • Find the output of the following C program: main(){int a[5]={2,3};printf(%d%d%d,a[2],a[3],a[4]);}
  • Find out the output of the given program or error if any. static int i=10; int main(){ i=25; // line 4 prin...
  • Find out the output of the following program or error (if any). #include<stdio.h>#include<conio.h>int main(...
  • main() { extern i; printf("%d",i); { int i=20; printf("%d",i); } }
  • What will be the output of the following set of codes after execution? void main() { printf(“%d”,sizeof(' '...
Play the full quiz 🎤 Practise this topic out loud

Practice this topic

  • Programming Output Evaluation (1721 questions)
Advertisement
© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy