Programming in C - Master Assignment

31. How many bits are absolutely necessary to store an ASCII character?

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 *


32. a << 1 is equivalent to

  • Option : A
  • Explanation :
    The left shift operator <<, pushes out the most significant (left-most) bit. If it happens to be a 1, a << 1, will not be same as multiplying a by 2
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 *


33. Assume an unsigned integer occupies 1 byte. Let myVar be an unsigned integer. Then myVar « 1 multiplies myVar by 2 if it is not greater than

  • Option : A
  • Explanation :
    If the most significant bit is to be zero, the maximum number that can be saved in 7 bits is 127.
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 *


34. In a certain machine, the sum of an integer and its 1's complement is 226 - 1. Then sizeof intl. in bits, will be

  • Option : D
  • Explanation :
    The sum (or bit-wise OR) of a number and its complement will be all 1's. How many 1's depends on how many bits are needed to represent the number. The sum is 220 - 1. then the sizeof(int) in bits must be 20.
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 *


35. Which of the following comments about the preprocessor directive # are correct?

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 *