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 |
What does *p++ do?
Explain union. What are its advantages?
regarding pointers concept
Should I use symbolic names like true and false for boolean constants, or plain 1 and 0?
hi how to convert program from notepad to turboc editor can u please help me
Do you know the use of fflush() function?
consider the following structure: struct num nam{ int no; char name[25]; }; struct num nam n1[]={{12,"Fred"},{15,"Martin"},{8,"Peter"},{11,Nicholas"}}; ..... ..... printf("%d%d",n1[2],no,(*(n1 + 2),no) + 1); What does the above statement print? a.8,9 b.9,9 c.8,8 d.8,unpredictable value
Are local variables initialized to zero by default in c?
Explain what is wrong with this program statement?
How do you generate random numbers in C?
If one class contains another class as a member, in what order are the two class constructors called a) Constructor for the member class is called first b) Constructor for the member class is called second c) Only one of the constructors is called d) all of the above
difference between function & structure