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 / 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 |
how can i print "hello"
How to find the digits truncation when assigning the interger variable to the character variables. like int i=500; char x = i : here we have truncation. how to find this. another ex: i =100; char x=i. here we do not have truncation.
Explain pointers in c programming?
What are variables and it what way is it different from constants?
How do you sort filenames in a directory?
Difference Between embedded software and soft ware?
marge linklist
Is array a primitive data type in c?
struct node {struct node*temp,*new} prinf("%d",sizeof(struct node));
What does int main () mean?
int x=5; printf("%d%d%d",x,x<<2,x>>2);
What does *p++ do? What does it point to?