This is a blog dedicated to all those problems I faced while making some things work, I might have struggled a lot to get the information from the net, this is to make my life easy whenever next time I want to do the same, or for someone who is in need of help, this may make their life easy too. Thanks for visiting my blog, feel free to mail me in case you have any questions.
Monday, May 10, 2010
Signed and Unsigned
1. What is the output of the following program
main() { unsigned int a = 10; int b = -19; puts((a+b)>0? "Positive":"Negative"); }
Answer : Positive Explanation : When signed and unsigned arithmetic is done, signed is converted to unsigned and result will be unsigned, ANSI C standard.
No comments:
Post a Comment