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
How do you search data in a data file using random access method?
What is the use of header?
What is a volatile keyword in c?
illustrate the use of address operator and dereferencing operator with the help of a program guys plzzz help for this question
Why #include is used in c language?
What are linked lists in c?
How do you determine whether to use a stream function or a low-level function?
Explain what are global variables and explain how do you declare them?
How can a string be converted to a number?
what is different between auto and local static? why should we use local static?
What does the function toupper() do?
What’s the special use of UNIONS?
what is the c source code for the below output? 5555555555 4444 4444 333 333 22 22 1 1 22 22 333 333 4444 4444 5555555555
Differentiate between static and dynamic modeling.
Explain the red-black trees?