Storage Class Questions and Answers

Practice Mode
Showing 10 of 97 questions
Q21
Find the output void main ( ) { int i=3; while (i<5) { static int j=2; printf ('5d", j++); i++; } }
  • A 2 2
  • B 3 2
  • C 2 3
  • D 3 3
Answer: Option C
Q22
Find the incorrect one for 'typedef' storage class
  • A Permits descriptive names for datatypes.
  • B Renaming existing datatype
  • C Modification of the program is easier when host machine is changed.
  • D All of the above
Answer: Option D
Q23
In which of the storage class, initialization is done only once ?
  • A Static
  • B Auto
  • C Extern
  • D Typedef
Answer: Option A
Q24
Which of the following is used to call a C module in C++.
  • A extern "C"
  • B extern "C++"
  • C iostream.h
  • D None of these
Answer: Option A
Q25
Find the output void main ( ) { int i; static int j=0; for (i=1; i<5;i++) call (j); } call (int j) { j++; printf (%d", j); }
  • A 1 2 3 4
  • B 1 1 1 1
  • C 0 1 2 3
  • D None of these
Answer: Option B
Q26
Which storage class variable is best suited for loop counter ?
  • A Auto
  • B Static
  • C Register
  • D Typedef
Answer: Option C
Q27
A variable having bloc scope is known as
  • A Local variable
  • B private variable
  • C Public variable
  • D Internal variable
Answer: Option A
Q28
Which of the following storage class creates a file scoping ?
  • A Auto
  • B Register
  • C Static
  • D Extern
Answer: Option C
Q29
If the CPU fails to keep the variable in CPU register, in that case the variables are assumed to be
  • A Automatic
  • B Static
  • C External
  • D None of these
Answer: Option A
Q30
Which of the following storage class creates a program scoping ?
  • A Auto
  • B Register
  • C Static
  • D Extern
Answer: Option D
Questions and Answers for Competitive Exams Various Entrance Test