1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Add two number in C#......

Discussion in 'C#' started by Patel, May 22, 2011.

  1. Patel

    Patel New Member

    Joined:
    Dec 5, 2010
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Student
    Location:
    Lucknow
    Code:
    using System;
    using System.Collections.Generic;
    using System.Text;
    
    namespace add_num
    {
        class Program
        {
            static void Main(string[] args)
            {
                Console.WriteLine("Enter the num");
                int a, b,c;
                Console.WriteLine("Enter the first no. :");
                a = Int32.Parse(Console.ReadLine());
                Console.WriteLine("Enter the second no :");
                b = Int32.Parse(Console.ReadLine());
                c = a + b;
                Console.WriteLine("total :" + c);
                Console.ReadLine();
    
            }
        }
    }
     
    Last edited by a moderator: May 22, 2011
  2. Patel

    Patel New Member

    Joined:
    Dec 5, 2010
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Student
    Location:
    Lucknow
    If you don't understand in this program you can ask the question.
     
  3. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,283
    Likes Received:
    364
    Trophy Points:
    83
    Make use of Code Blocks when you have code in the post
     

Share This Page