C# Program to add two numbers
Program
using System;
namespace add_two_numbers
{
class AddTwoNumbers
{
static void Main(String[] args)
{
int a, b;
Console.Write("Enter first number:\t");
a = int.Parse(Console.ReadLine());
Console.Write("Enter second number:\t");
b = int.Parse(Console.ReadLine());
int sum = a + b;
Console.WriteLine("Sum of two numbers: " + sum);
}
}
}
Output
$ mcs AddTwoNumbers.cs
$ mono AddTwoNumbers.exe
Enter first number: 34
Enter second number: 567
Sum of two numbers: 601