using System; class MainClass { public static void Add(int x,int y, out int ans) { ans = x + y; } public static void Main() { Console.WriteLine("Adding 2 ints using out keyword"); int ans; Add(90, 90, out ans); Console.WriteLine("90 + 90 = {0}\n", ans); } }
Adding 2 ints using out keyword 90 + 90 = 180