Storage Class Questions and Answers

Practice Mode
Showing 10 of 97 questions
Q31
Find the output main ( ) { show ( ); show ( ); } int show ( ) { static int a=5; a++; printf("5d", a); }
  • A 5 5
  • B 6 6
  • C 5 6
  • D 6 7
Answer: Option D
Q32
Which of the following storage class creates a block scoping ?
  • A Auto
  • B Register
  • C Static
  • D Extern
Answer: Option A
Q33
Find the output. void main ( ) { int x; #include<stdio.h> x=printf("clrscr ( )"); printf('5d", x); }
  • A c1rscr()8
  • B c1rscr()
  • C Run time error
  • D Compile time error
Answer: Option A
Q34
Writing static to a global variable means
  • A The variable is only visible to that file
  • B The variable is only visible to other file
  • C The variable is only visible to all file
  • D None of these
Answer: Option A
Q35
Which of the following is not decided by storage class ?
  • A Storage
  • B Life
  • C Address
  • D Scope
Answer: Option C
Q36
The storage class which has no storage, life, initial value, scope and linkage is
  • A Auto
  • B Register
  • C Extern
  • D Typedef
Answer: Option D
Q37
The storage class which creates new name of the data type
  • A Auto
  • B Register
  • C Extern
  • D Typedef
Answer: Option D
Q38
Find the output main ( ) { show ( ); show ( ); } int show ( ) { extern int a; a++; printf('%d", a); } int a=5; }
  • A 5 5
  • B 6 6
  • C 5 6
  • D 6 7
Answer: Option D
Q39
Find the output int a=20; void main () { int a=5; { int a=10; } printf("5d", a); }
  • A 20
  • B 5
  • C 10
  • D None of these
Answer: Option B
Q40
Which of the storage class allocates memory in run time ?
  • A Auto
  • B Register
  • C Static
  • D Extern
Answer: Option A
Questions and Answers for Competitive Exams Various Entrance Test