Home » C# Programming » Structures

Which of the following will be the correct output for the program given below? namespace CuriousTabConsoleApplication { struct Sample { public int i; } class MyProgram { static void Main(string[] args) { Sample x = new Sample(); Sample y; x.i = 9; y = x; y.i = 5; Console.WriteLine(x.i + " " + y.i); } } }

Correct Answer: 9 5

← Previous Question Next Question→

More Questions from Structures

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion