Storage Class Questions and Answers

Practice Mode
Showing 10 of 97 questions
Q51
What is the storage class of function PRINT() and find the output? void main ( ) { auto PRINT(); PRINT(); } PRINT ( ) printf('printing"); }
  • A Auto, printing
  • B Extern, printing
  • C Static, printing
  • D Compilation error
Answer: Option B
Q52
Find the output void main ( ) { tuypedef int float; float x=4;7; printf('%d", sizeof(x)); }
  • A 4
  • B 2
  • C Compilation error
  • D None of these
Answer: Option C
Q53
Find the output void main ( ) { extern i; printf('%d\n",i); { nt i=20; printf ('%d\n', i); } }
  • A 20 20
  • B Garbage 20
  • C 0 20
  • D Linker Error
Answer: Option D
Q54
To ver come the dangling pointer which of the following is used ?
  • A Auto
  • B Register
  • C Static
  • D Extern
Answer: Option C
Q55
Find the output void main ( ) { goto next; { int i=10; static j=20; next:printf('5d %d", i, j); }
  • A Garbage garbage
  • B Garbage 20
  • C Compile time error underdifined symbol
  • D Run time error undefined symbol
Answer: Option B
Q56
Find the output int main ( ) { static int i=5; if (-i--) { main ( ); printf('5d",i); } return (0); }
  • A 000000
  • B -1-1-1-1-1
  • C 54321
  • D 543210
Answer: Option B
Q57
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); }
  • A Garbage name
  • B 1 name
  • C 5 name
  • D Compilation error
Answer: Option A
Q58
Find the output void main ( ) { register int a=5; register int *b=&a; printf("%d %d", a, *b); }
  • A 5 5
  • B Garbage value
  • C Compilation error
  • D None of the above
Answer: Option C
Q59
Storage class to be allocated to the object during
  • A Declaration
  • B Definition
  • C Compilation
  • D Execution
Answer: Option C
Q60
Pointer can't work with which storage class ?
  • A Auto
  • B Register
  • C Extern
  • D Static
Answer: Option B
Questions and Answers for Competitive Exams Various Entrance Test