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

11. Which variables can't be used as function parameters ?

  • Auto
  • Register
  • Static
  • None of the above
Show Answer Report

12. Find the output. int x=5; void main ( ) { int i=1; { extern int x; printf('%d", x); }

  • Error: multiple declaration is not allowed
  • 1
  • 5
  • Garbage
Show Answer Report

13. Static storage class can be used as :

  • External variable
  • Local variable
  • Register variable
  • Both a and B
Show Answer Report

14. Static global variable have

  • Internal linkage
  • External linkage
  • No linkage
  • None of these
Show Answer Report

15. What is the output? int x=1; void main ( ) { printf('5d", x--); }

  • Garbage value
  • 1
  • Compilation error
  • None of these
Show Answer Report

16. Find the output. int x; void main ( ) { extern int x=5; printf (5d", x); }

  • 5
  • No output
  • Compilation error
  • None of these
Show Answer Report

17. Why address of registervariable can't be found using '&" operator?

  • Register variable are not stored in memory
  • Register of the cpu usually not addressable
  • Register vaiable is not suitable for long value.
  • Register variable are runtime variable.
Show Answer Report

18. Static variable are useful in

  • Sharing the same memory location into different frame of recursion.
  • File sciping
  • overcome dangling pointer
  • All of the above
Show Answer Report

19. Find the output if the value of x is given as 5 void main ( ) { register int x; scanf ('5d", &x; printf('%d", x); }

  • 5
  • 0
  • Garbage
  • Compilation error
Show Answer Report

20. In a program if we declare both external and auto variables then the first priority will goes to which variable ?

  • External variable
  • both have equal priority
  • Auto variabe
  • None of these
Show Answer Report
Questions and Answers for Competitive Exams Various Entrance Test