RE: What is the value of y in the following code?x=7;y=0;if(x=6)y=7;else y=1;a.7b.0c.1d.6
Answer for this is : a that is y value is 7. Here assignment statement get executed in if condition which evaluates to true, so 7 will be assigned to y.
RE: What is the value of y in the following code?x=7;y=0;if(x=6)y=7;else y=1;a.7b.0c.1d.6
if(x=6) meens in this x will be assigned to 6 and the condition is non zero value. so if part will excute and y will be assigned to 7. thus the y value is 7.