Sunday, 22 August 2010

using integer parsing code and source code for addition

//using integer parsing code and source code for addition

using System;
class VarDemo
{
//adddition source code
static void Main()
{
int x, y, z;
Console.Write("Enter x value: ");
x = int.Parse(Console.ReadLine());
Console.Write("Enter y value: ");
y = int.Parse(Console.ReadLine());
z = x + y;
Console.WriteLine("Sum of " + x + " and " + y + "is: " + z);
}
}

No comments:

Post a Comment