Addition of two numbers in C#

Simple program of adding two numbers in C# language by using Console method.

Program of addition of two numbers program in c#

	
    using System;
    using System.Collections.Generic;
    using System.Text;

    namespace additiontwonumber
    {
        class Program
        {
             static void Main(string[] args)
             {
                 int a, b, c;
                 Console.WriteLine("ENTER THE VALUE OF A :- ");
                 a = Convert.ToInt32(Console.ReadLine());
                 Console.WriteLine("ENTER THE VALUE OF B :- ");
                 b = Convert.ToInt32(Console.ReadLine());
                 c = a + b;
                 Console.WriteLine("ADDITION OF TWO NUMBER IS :- "+c);
                 Console.ReadLine();
             }
        }
    }
	

Output

	
   ENTER THE VALUE OF A :- 5
   ENTER THE VALUE OF B :- 12
   
   ADDITION OF TWO NUMBER IS :- 17
    

Post Your Comment