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 value of uninitialized variable in c?
How do you use a pointer to a function?
What is clrscr in c?
Why static is used in c?
What is variables in c?
Is swift based on c?
How many types of arrays are there in c?
Define circular linked list.
Explain what is dynamic data structure?
What are loops c?
What is the best style for code layout in c?
Why we use int main and void main?
What are the types of variables in c?
The postoder traversal is 7,14,3,55,22,5,17 Then ur Inorder traversal is??? please help me on this
If a five digit number is input through the keyboard, write a program to print a new number by adding one to each of its digits.For example if the number that is input is 12391 then the output should be displayed as 23402