C Programming MCQ

1: The program fragment int i =263; purchar(i); prints
A. 263
B. ASCII equivalent of 263
C. Rings the bell
D. undefined
 

Answer : C

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

Write your comments here:


Report Error
 

Option: A

Explanation : Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here.