Sail E0 Webinar
Question
What is the output of this C code?
int main()
{
char chr;
chr = 128;
printf("%d\n", chr);
return 0;
}
Options:
A .  128
B .  - 128
C .  Depends on the compiler
D .  None of the mentioned
Answer: Option B


signed char will be a negative number.
Output:
$ cc pgm2.c
$ a.out
-128



Was this answer helpful ?
Next Question

Submit Solution

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

Latest Videos

Latest Test Papers