Programming in C - Constants, Variables and Data Types

26. Which of the following comments regarding the reading of a string, using scanf(with optional) and get is true?

Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


27. If integer needs two bytes of storage, then maximum value of a signed integer is

  • Option : B
  • Explanation :
    In signed magnitude form, one bit is dedicated to store the sign(e.g., 1 for negative and otherwise). Only the remaining 15 bits are available to store the magnitude. Hence the answer.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


28. The minimum number of temporary variables needed to swap the contents of two variables is

  • Option : D
  • Explanation :
    Without any temporary variable, one can swap two given variables.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


29. If s and b are integers then purpose of the following program fragment is to
b = s + b ;
s = b - s ;
b = b - s ;

Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


30. If integer needs two bytes of storage, then maximum value of an unsigned integer is

Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *