what would be the output of the following prog? Justify
your answer?
main()
{
unsigned char ch;
unsigned char i;
ch = -255;
printf("%d",ch);
i = -1;
printf("%d",i);
}
Answer Posted / bittu
1255
this is because -255 (00000001) when considered unsigned
looks like 1(00000001) in binary and -1(11111111) when
considered unsigned looks like 255(11111111) in binary
(11111111).
refer to this
http://www.allaboutcircuits.com/vol_4/chpt_2/3.html
| Is This Answer Correct ? | 5 Yes | 0 No |
Post New Answer View All Answers
any "C" function by default returns an a) int value b) float value c) char value d) a & b
What is the difference between union and anonymous union?
Is array a primitive data type in c?
Why is python slower than c?
Which operators cannot be overloaded a) Sizeof b) .* c) :: d) all of the above
What is data type long in c?
Difference between pass by reference and pass by value?
What is a void * in c?
What are the types of functions in c?
Define and explain about ! Operator?
largest Of three Number using without if condition?
Define C in your own Language.
What is .obj file in c?
What is the general form of #line preprocessor?
Can you think of a logic behind the game minesweeper.