+ 4

What is the output of this code?

Int x=0; Int &y=x; Y=5; while(x<=5){ cout<<y++; x++; } cout<<x;

20th Jan 2018, 10:02 AM
Kumari Samiksha
Kumari Samiksha - avatar
1 Answer
+ 1
Error because Int is undefined, next error because Y is undefined. However, if you remove these, output is 57 because y is a reference of x and therefore y++ also affects x.
20th Jan 2018, 10:37 AM
Shadow
Shadow - avatar