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

41. Find the output void man ( ) { har *p; char (show( ); p=show ( ); printf('%c", *p; } char *show() { char *m; m=(char *p) malloc(1); *m='b'; ++*m; return m; }

  • B
  • C
  • Garbage
  • Compilation error
Show Answer Report

42. Find the output void main ( ) { char *p='CITE"; char *q; q=(char *) malloc (strlen(p)); while (*q++); printf("%s", q); }

  • CITE
  • ITE
  • NULL
  • None of these
Show Answer Report

43. To access a semi-global variable

  • Auto is used
  • Register is used
  • Extern is used
  • Static is used
Show Answer Report

44. Find the output. int i=4; void main ( ) { int i=1; { sttic int i=5; } printf('5d', i); }

  • 4
  • 1
  • 5
  • 0
Show Answer Report

45. Which storage class allocates and deallocates memory without the knowledge of user?

  • Auto
  • Register
  • Static
  • Extern
Show Answer Report

46. Which storage class share memory into different frames of the function recursion ?

  • Auto
  • Static
  • Register
  • Extern
Show Answer Report

47. External variable can not be initialized, because

  • It is a variable declaration
  • It is a run time variable
  • It is variable definition
  • None of these
Show Answer Report

48. Which register holds base address of code segment ?

  • CS
  • DS
  • ES
  • SS
Show Answer Report

49. Find the  output void main ( ) { int const * size=10; printf('5d", ++size); }

  • 10
  • 11
  • 12
  • Compilation error
Show Answer Report

50. What are the allowed storage class in function prototype declaration ?

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