0
Why is y = 8 in the below code
Int y; Int X=3 y= (X<=5)? y: X Printf("%d", y);
4 Answers
+ 1
y has a random value because you haven't initialized it with one.
+ 1
Try to change the two values and see for yourself.
In the beginning, y is uninitialized, so random value in it.
Then, if x<=5 (which it is) y will have the value of y, otherwise of X.
So y still has what it had in the beginning.
+ 1
Great! Thanks a ton mate. That helped
0
You mean to say that 8 is a random value? Nothing related to 3+5?