Programming in C - Constants, Variables and Data Types

6. The program fragment
int i = 263 ;
putchar (i) ;
prints

  • Option : C
  • Explanation :
    263 in binary form is 100000111. If one tries to print an integer as a character, only the last 8 bits will be considered - the rest chopped off. So, in this case, the ASCII value of 00000111 will be printed, Look in the ASCII table. It is ringing a bell!
Cancel reply
Cancel reply

9. The value of ab if ab & 0 x 3f equals 0 x 27 is

  • Option : D
  • Explanation :
    Let ab be 0 x MN. N&f should yield 7 i.e. N & 1111 should produce 0111. So, N should be 0111, i.e., 7. Similarly, M can be found to be 2. So, ab is 0 x 27.
Cancel reply
Cancel reply