0 votes 0 votes The program fragment: int i= 263; putchar (i) (a) prints 263 (b) prints the ASCII equivalent of 263 (c) rings the bell (d) prints garbage Programming in C programming-in-c + – sayakpaul asked Dec 23, 2018 sayakpaul 2.6k views answer comment Share Follow See 1 comment See all 1 1 comment reply adarsh_1997 commented Dec 23, 2018 reply Follow Share c? 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes answer is b putchar is a function in the C programming language that writes a single character to the standard output stream, stdout. Its prototype is as follows: int putchar (int character) sdihingia answered Dec 23, 2018 sdihingia comment Share Follow See 1 comment See all 1 1 comment reply sayakpaul commented Dec 23, 2018 reply Follow Share But the number 263 cannot be accommodated in 8 bits. I say this because in C a character is only given 1 byte. 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes 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 (i.e. decimal 7) will be printed. look in the ASCII table. It is ringing the bell! https://stackoverflow.com/a/3456167/10514676 digvijaydeshmukh answered Aug 19, 2019 digvijaydeshmukh comment Share Follow See all 0 reply Please log in or register to add a comment.