public class ArrayExample
public static int Sum(int num1, int num2)
public static void Main(string[] args)
Console.Write("\nTao ham tu dinh nghia de tinh tong hai so trong C#:\n");
Console.Write("--------------------------------------------------\n");
Console.Write("Nhap so hang thu nhat: ");
int n1 = Convert.ToInt32(Console.ReadLine());
Console.Write("Nhap so hang thu hai: ");
int n2 = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("\nTong hai so: {0} \n", Sum(n1, n2));