Storage Class Questions and Answers

Practice Mode
Showing 10 of 97 questions
Q61
Find the output void main ( ) { static int i=i++, j=j++; printf('%c", s); } printf("%d", s); }
  • A 11
  • B Garbage value
  • C Compilation error
  • D None of these
Answer: Option C
Q62
Find the output void main ( ) { static int i=i++, j=j++; printf("%d%d", i, j); }
  • A 11
  • B Garbage value
  • C Compilation error
  • D None of these
Answer: Option C
Q63
Find the output char s; void main ( ) { s='a}'; { static char s='b'; printf ('%c",s); }
  • A b97
  • B b0
  • C b49
  • D Compilation error
Answer: Option A
Q64
The extern storage class can be used to
  • A Access a variable from another file.
  • B Access a global variable.
  • C Both a and b
  • D None of these
Answer: Option C
Q65
Find the output void main ( ) { show ( ); dis ( ); } show ( ) { extern int x; x--; printf("%d", x); } int x=10; dis ( ) { { x++; printf('%d", x); }
  • A 10 11
  • B Garbage 11
  • C 9 10
  • D Compilation error
Answer: Option C
Q66
Find the output void main ( ) { extern int a; a=10; printf("5d", sizeof (a)); }
  • A 2
  • B 0
  • C Compilation error
  • D None of these
Answer: Option C
Q67
Find the output int a=6; void main ( ) { static int *x=&a; printf('5d", *x); }
  • A 6
  • B 0
  • C Compilation error
  • D None of these
Answer: Option A
Q68
State the incorrect statement
  • A Memory for a static variable is not deallocated until the entire program terminates.
  • B Memory for a static variable is allocated exactly once, at the very beginning of program execution.
  • C Static variable is visible throughout the function, but not outside.
  • D Static variable creates program scoping.
Answer: Option D
Q69
The disadvantages of external storage class is/are
  • A The storage for an external variable exists even when the variable is not needed
  • B The side effect may produce surprising output
  • C Modification of the program is difficult
  • D All of these
Answer: Option D
Q70
The advantages of external storage calss
  • A Persistent storage of a variable retains the latest value
  • B The value is globally available
  • C Generality of a program is affected
  • D Both a and b
Answer: Option D
Questions and Answers for Competitive Exams Various Entrance Test