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
What is the use of in c?
What will be the outcome of the following conditional statement if the value of variable s is 10?
Write a program to swap two numbers without using the third variable?
write a c programming using command line argument,demonstrate set operation(eg;union,intersection,difference) example output is c:>setop 12 34 45 1 union 34 42 66 c:>setop 12 34 1 42 66 c:>setop 12 34 diff 12 56 67 78 setop 12 34
All technical questions
Where does the name "C" come from, anyway?
What's the total generic pointer type?
Explain low-order bytes.
What is c programing language?
Explain continue keyword in c
What does it mean when the linker says that _end is undefined?
Is c is a low level language?
what are the advanced features of functions a) function declaration and prototypes b) calling functions by value or by reference c) recursion d) all the above
how to construct a simulator keeping the logical boolean gates in c
What is the use of linkage in c language?