1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

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,276
    Likes Received:
    364
    Trophy Points:
    83
    Make use of Code Blocks when you have code in the post
     

Share This Page