Programming in C - Constants, Variables and Data Types

46. Choose the correct statements

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 *


47. Choose the correct statements

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 *


48. If a variable can take only integral values from 0 to n. where n is a constant integer, then the variable can be represented as a bit-field whose width is the integral part of (the log in the answers arc to the base 2)

  • Option : A
  • Explanation :
    Let n = 7. It needs actually a 3 bit-field. But log (n + 1) + 1 will be log (8) + 1, i.e., 4, which is wrong.
    If n = 8, 4 bits are needed. But, log (n - 1) + 1 will be log (7) + 1, which will have an integral part of 3.
    log(n) + 1 will yield the correct result in both the cases.
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 *


49. In a C program constant is defined

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 *


50. The rule for implicit type conversion 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 *