W
Walter Roberson
Obviously the given code would not compile on any comipler because of
missing header and all & we are assumed to add that(Mere common sense).
and the code which i compiled was:
#include<stdio.h>
main()
{
char ch;
ch = '7';
printf("%d\n",ch);
return 0;
}
Now is it okay for you.
You extrapolated incorrect code, as you used an improper declaration
of main().
If you are going to extrapolate code anyhow, then why not
extrapolate something slightly different, such as
#define printf(a,b) (b / a[3])
instead of #include <stdio.h> ?
What's that you say, that's not what the original poster intended?
And you know that exactly how?? And since the original question
was obviously some kind of test material, do you presume that
you know the intention of the original test author as well??
Now compile it and it will print "55".
Several people corrected you on that already but you did not appear
to listen. "55" is, at best, the most -common- result of the
program. If the program were run on an EBCDIC system, the result
would be quite different. And in saying that it will print "55"
you missed the newline...