C# Program to Add Two Integers.

C# Programming Language / Overview of C# Language

797

Program:

using System;

namespace TechStudyCSharp
{
    class Program
    {
        static void Main(string[] args)
        {
            int num1;
            int num2;
            int total;

            Console.WriteLine("Enter first number :");
            num1 = Convert.ToInt32( Console.ReadLine());
            Console.WriteLine("Enter second number :");
            num2 = Convert.ToInt32(Console.ReadLine());         
            total = num2 + num1;         
            Console.WriteLine("Total is : "+ total);
            Console.ReadKey();
        }
    }
}

Output:

Enter first number :                                                                                                                                            
12                                                                                                                                                              
Enter second number :                                                                                                                                           
13                                                                                                                                                              
Total is : 25 

Explanation:

Addition of two number in c# programming language

This Particular section is dedicated to Programs only. If you want learn more about C# Programming Language. Then you can visit below links to get more depth on this subject.