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

51. What is the storage class of function PRINT() and find the output? void main ( ) { auto PRINT(); PRINT(); } PRINT ( ) printf('printing"); }

  • Auto, printing
  • Extern, printing
  • Static, printing
  • Compilation error
Show Answer Report

52. Find the output void main ( ) { tuypedef int float; float x=4;7; printf('%d", sizeof(x)); }

  • 4
  • 2
  • Compilation error
  • None of these
Show Answer Report

53. Find the output void main ( ) { extern i; printf('%d\n",i); { nt i=20; printf ('%d\n', i); } }

  • 20 20
  • Garbage 20
  • 0 20
  • Linker Error
Show Answer Report

54. To ver come the dangling pointer which of the following is used ?

  • Auto
  • Register
  • Static
  • Extern
Show Answer Report

55. Find the output void main ( ) { goto next; { int i=10; static j=20; next:printf('5d %d", i, j); }

  • Garbage garbage
  • Garbage 20
  • Compile time error underdifined symbol
  • Run time error undefined symbol
Show Answer Report

56. Find the output int main ( ) { static int i=5; if (-i--) { main ( ); printf('5d",i); } return (0); }

  • 000000
  • -1-1-1-1-1
  • 54321
  • 543210
Show Answer Report

57. Find the output. #define max 5typedef int arr1[max]; void main ( ) { typedef char arr2{max]; arr1 list [2] ={0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; arr2 name [ ] ={"name"}; printf("%d %s", list [1], name); }

  • Garbage name
  • 1 name
  • 5 name
  • Compilation error
Show Answer Report

58. Find the output void main ( ) { register int a=5; register int *b=&a; printf("%d %d", a, *b); }

  • 5 5
  • Garbage value
  • Compilation error
  • None of the above
Show Answer Report

59. Storage class to be allocated to the object during

  • Declaration
  • Definition
  • Compilation
  • Execution
Show Answer Report

60. Pointer can't work with which storage class ?

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