nitin Oct 8th, 2005 Look at the code carefullyif(x =6) and not if(x==6).So after this instruction x will be made equal to 6 and next instruction will follow which will make y = 7. So the ans is 7..

Chithambaram.P Profile Answers by Chithambaram.P Questions by Chithambaram.P Jan 11th, 2007 Answer is y=7 Becoz here we r assigning the value to x=6,not checking condition,we will see the operator meaning carefully

rohit dwivedi9450 Profile Answers by rohit dwivedi9450 Questions by rohit dwivedi9450 Aug 22nd, 2007 scope of x=6 will take precedenc on x=7so y=7

## 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

This question is related to TCS Interview## Related Answered Questions

## Related Open Questions