Storage Class Questions and Answers

Practice Mode
Showing 10 of 97 questions
Q91
Which storage class can retain values in between system calls ?
  • A auto
  • B static
  • C extern
  • D Global
Answer: Option B
Q92
The static storage class specifier can not be applied to
  • A Functions
  • B Function declarations within a block
  • C Anonymous unions
  • D All of these
Answer: Option C
Q93
Find the output. void main (register int argc) { static int y; y=argc; printf("%d",y); }
  • A 0
  • B 1
  • C 2
  • D Compilation error
Answer: Option B
Q94
Find the output int main (void); int main ( ) { unsigned int static main =4; int (*p) ( ); p=(int *) main ; (*p) ( ); printf("%d", main++); return 0; }
  • A 4
  • B stack overflow
  • C Abnormal program termination
  • D Compilation error
Answer: Option C
Q95
Find the output main ( ) { static int a[5]={1, 2, 3, 4, 5}; static int b[5]={6, 7, 8, 9, 10}; int i; for (i=0; i<10; i++) printf("%d", a[i]); }
  • A 1, 2, 3, 4, 5, 0, 0, 0, 0, 0
  • B 1,2,3,4,5,6,7,8,9,10
  • C 1,2,3,4,5,garbage
  • D None of these
Answer: Option B
Q96
Choose the correct one a.c a) static char x[4000]; void main ( ) { } b.c b) void main ( ) { auto char x[4000]; }
  • A Size of a is more than size of b
  • B size of b is more than size of a
  • C both a and b is same size
  • D None of the above
Answer: Option A
Q97
How many time the loop wil iterate ? void main ( ) { register char i=1; while (i) { printf("%d", i); i++; } }
  • A infinite times
  • B 255 times
  • C 65535 times
  • D none of these
Answer: Option B
Questions and Answers for Competitive Exams Various Entrance Test