using System;
class MethodCalling
{
public static void Main(string[] args)
{
int value1 = 0, value2 = 0;
int total = 0;
Console.Write("Enter first value: ");
value1 = Convert.ToInt32(Console.ReadLine());
Console.Write("Enter second value: ");
value2 = Convert.ToInt32(Console.ReadLine());
total = addition(value1, value2);
Console.WriteLine("Total of {0} and {1} is {2}", value1, value2, total);
}
static int addition(int x, int y)
{
return x + y;
}
}Output
Enter first value: 4
Enter second value: 5
Total of 4 and 5 is 9
