Functions – C# Programming Interview Questions – Real

(Last Updated On: October 21, 2016)

Only Real C# programming interview questions with answers for freshers and experienced asked in Technical interviews.

Q – Does below code compile? If not, what is the issue?

 

Answer: There is a compiler error, as in method Y(out int val),val is being read(at line: Console.WriteLine(“Value:”+val);) before assignment to “out” variable i.e. val =10. we can’t read value of out variable before assignment but later.