How to Add Two Integer Numbers in C#

Write a simple Program to Add two Integer  numbers in C#.

using System;
namespace add

{
    class Program
    {
        static void Main(string[] args)
        {
            int a = 10, b = 20, sum;

            sum = a + b;
            Console.WriteLine("Sum of Two Number: ");
            Console.WriteLine("{0}+{1}={2}", a, b, sum);

            Console.ReadKey();

        }

    }

}

Output:




*

Post a Comment (0)
Previous Post Next Post