The function martian() has a prototype of:
void martian(int ch);
and an implementation of:
void (int ch)
{
printf("%c" ,ch);
return;
}
it is called from main as
int md= 0x45;
martian(md);
What is printed on the screen?
#include <stdio.h> void martian(int ch){ printf("%c" ,ch); return; } int main() { int md= 0x45; martian(md); return 0; }
E
HEX DIGIT | DEC VALUE | MULTIPLICATION | RESULT | |
5 | 5 | 5 * 160 | 5 | |
4 | 4 | 4 * 161 | 64 |
Add together all products 5 + 64 = 69
So, 0x45 in decimal is 69
ASCII value for decimal 69 is E
So, output of code is E
In other words, ASCII value for hex 0x45 is E, So code prints E
Get Answers For Free
Most questions answered within 1 hours.