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

Patel's Avatar
Light Poster
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 shabbir; 22May2011 at 10:00.. Reason: Code blocks
0
Patel's Avatar
Light Poster
If you don't understand in this program you can ask the question.
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Make use of Code Blocks when you have code in the post