Under what circumstances will the “False” part of the following code be executed?
x = 20;
y = -30;
if (x > y) {
// True part
}
else {
// False part
}
NB: Language is C, compiler is gcc (although some other compilers may also do the same thing).
If
yis of unsigned integer type it will be initialized to some very large value (because of how negative integer values are represented) and the comparison expression will evaluate tofalse.