+ 3
What should be the output of the program and why??
According to me hello should print but output is world. https://code.sololearn.com/ckK1ZJp41hjL/?ref=app
2 Answers
+ 4
C does implicit type casting in this case. Since you can't compare between unsigned and signed integers directly C must to decide which one to use. If it decides to use unsigned values the -23 is seen to a much larger positive value because unsigned values can't be negative and are interpreted differently.
To avoid such weird behaviour you should only compare the same data types.
+ 1
line no 4.
->signed int i=23;
not->unsigned int i=23;