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

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


Cancel reply

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


7. int i = 5; is a statement in a C program.

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 *


8. If the declaration unsigned c:5; is replaced by unsigned: 6; then

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 *


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

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


Cancel reply

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


10. In C programming language, if the first and the second operands of operator + are of types int and float, respectively, the result will be of type

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 *