Search This Blog

Saturday, 7 September 2013

Addtion of two numbers by C#

Addition of two numbers


using System;

public class Sum
{
    
public static void Main(String[] args)
{
int a,b,c;                                                   Console.WriteLine("Enter the value for a:");
a=Convert.ToInt32(Console.ReadLine());                                         Console.WriteLine("Enter the value for b:");
b=Convert.ToInt32(Console.ReadLine());
c=a+b;
Console.WriteLine("Answer of {0}+{1}:{2}",a,b,c);
Console.ReadLine();
}
}

output :

No comments:

Popular Posts