Storage Class Questions and Answers

Take Exam

Storage Class Questions with Answers are a core part of C programming aptitude and interview tests. These programming questions and answers cover storage types like auto, static, register, and extern, which define variable scope and lifetime. Frequently asked in Wipro, Tech Mahindra, and TCS exams, storage class MCQs evaluate your understanding of memory management and code optimization. Solving these C programming MCQs with detailed explanations will enhance your technical readiness. You can practice online or download free PDFs of storage class questions for quick revision.

Storage Class

Showing 10 of 97 questions

21. Find the output void main ( ) { int i=3; while (i<5) { static int j=2; printf ('5d", j++); i++; } }

  • 2 2
  • 3 2
  • 2 3
  • 3 3
Show Answer Report

22. Find the incorrect one for 'typedef' storage class

  • Permits descriptive names for datatypes.
  • Renaming existing datatype
  • Modification of the program is easier when host machine is changed.
  • All of the above
Show Answer Report

23. In which of the storage class, initialization is done only once ?

  • Static
  • Auto
  • Extern
  • Typedef
Show Answer Report

24. Which of the following is used to call a C module in C++.

  • extern "C"
  • extern "C++"
  • iostream.h
  • None of these
Show Answer Report

25. Find the output void main ( ) { int i; static int j=0; for (i=1; i<5;i++) call (j); } call (int j) { j++; printf (%d", j); }

  • 1 2 3 4
  • 1 1 1 1
  • 0 1 2 3
  • None of these
Show Answer Report

26. Which storage class variable is best suited for loop counter ?

  • Auto
  • Static
  • Register
  • Typedef
Show Answer Report

27. A variable having bloc scope is known as

  • Local variable
  • private variable
  • Public variable
  • Internal variable
Show Answer Report

28. Which of the following storage class creates a file scoping ?

  • Auto
  • Register
  • Static
  • Extern
Show Answer Report

29. If the CPU fails to keep the variable in CPU register, in that case the variables are assumed to be

  • Automatic
  • Static
  • External
  • None of these
Show Answer Report

30. Which of the following storage class creates a program scoping ?

  • Auto
  • Register
  • Static
  • Extern
Show Answer Report
Questions and Answers for Competitive Exams Various Entrance Test