Machine-translated by Google. Questions are authored in English.
Top

Discussion

Which of the following statement are correct?

(i) The maximum value a variable can hold depends upon its storage class.
(ii) By default all variables enjoy a static storage class.

  • A.Only I is correct
  • B.Only II is correct
  • C.Both I & II are correct
  • D.Both I & II are incorrect

Answer: D

Correct answer: Both I & II are incorrect

(i) is false: the range of a variable depends on its type - char, int, long - not on where it is stored. A static int and an auto int hold exactly the same range. (ii) is false: the default for a variable declared inside a function is auto, not static; only file-scope variables have static storage duration.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.