Storage Class Questions and Answers

Practice Mode
Showing 10 of 97 questions
Q11
Which variables can't be used as function parameters ?
  • A Auto
  • B Register
  • C Static
  • D None of the above
Answer: Option C
Q12
Find the output. int x=5; void main ( ) { int i=1; { extern int x; printf('%d", x); }
  • A Error: multiple declaration is not allowed
  • B 1
  • C 5
  • D Garbage
Answer: Option C
Q13
Static storage class can be used as :
  • A External variable
  • B Local variable
  • C Register variable
  • D Both a and B
Answer: Option D
Q14
Static global variable have
  • A Internal linkage
  • B External linkage
  • C No linkage
  • D None of these
Answer: Option A
Q15
What is the output? int x=1; void main ( ) { printf('5d", x--); }
  • A Garbage value
  • B 1
  • C Compilation error
  • D None of these
Answer: Option B
Q16
Find the output. int x; void main ( ) { extern int x=5; printf (5d", x); }
  • A 5
  • B No output
  • C Compilation error
  • D None of these
Answer: Option C
Q17
Why address of registervariable can't be found using '&" operator?
  • A Register variable are not stored in memory
  • B Register of the cpu usually not addressable
  • C Register vaiable is not suitable for long value.
  • D Register variable are runtime variable.
Answer: Option A
Q18
Static variable are useful in
  • A Sharing the same memory location into different frame of recursion.
  • B File sciping
  • C overcome dangling pointer
  • D All of the above
Answer: Option D
Q19
Find the output if the value of x is given as 5 void main ( ) { register int x; scanf ('5d", &x; printf('%d", x); }
  • A 5
  • B 0
  • C Garbage
  • D Compilation error
Answer: Option D
Q20
In a program if we declare both external and auto variables then the first priority will goes to which variable ?
  • A External variable
  • B both have equal priority
  • C Auto variabe
  • D None of these
Answer: Option C
Questions and Answers for Competitive Exams Various Entrance Test