This return statement returns bullion.
The expression x > y
is actually true
when x
is greater than y
, or false
. If you want to get the result of that calculation right away, you can write it like that.
If you write that long, it'll look like this.
int gt(long x, long y)
{
if (x > y) {
return true;
} } else {
return false;
}
}
But because it's more readable (not only grammatically the same) than writing it like this ("Ah, you're comparing the two numbers now to determine whether they're large or small!"), it's advantageous to write it like above.
© 2024 OneMinuteCode. All rights reserved.