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

Discussion

A declaration "short int" is used for variables

  • A.which have a short duration in a program
  • B.which have short names
  • C.which may require less storage than normal integers
  • D.all of these

Answer: C

Correct answer: which may require less storage than normal integers

short int requests an integer type that occupies no more storage than int, and typically less - commonly 2 bytes against 4. The standard guarantees only a minimum range and the ordering short ≤ int ≤ long, not any particular size.

The name refers to storage, not to the variable's lifetime or the length of its identifier. It is used where memory matters - in large arrays or in structures mapped onto a hardware or file format - at the cost of a narrower range.

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

Post your comment

Please log in or register to post a comment.