Welcome :Guest

 Sign In Register
Win Surprise Gifts!!!
Congratulations!!!

Top 5 Contributors of the Month
yasminpriya
Ram
Gaurav Pal
christianasteves

 Home >> Code Snippets >> Visual Studio >> Post New Resource

# Arithmatic operation

Posted By:SanthoshNathan       Posted Date: November 08, 2010    Points: 15    Category: Visual Studio    URL: http://www.dotnetspark.com

Arithmatic operation

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace arithmatic
{
class Program
{
static void Main(string[] args)
{
int a, b, c;
Console.WriteLine("********* Arithmatic operations **********");
Console.WriteLine("ADDITION");
Console.WriteLine("****************************************************");
Console.WriteLine("Enter the first value");
a = int.Parse(Console.ReadLine());
Console.WriteLine("Enter the Second value");
b = int.Parse(Console.ReadLine());
c = a + b;
Console.WriteLine("Addition is = "+c);
Console.WriteLine("****************************************************");
Console.WriteLine("****************************************************");
Console.WriteLine("Subtraction");
Console.WriteLine("Enter the first value");
a = int.Parse(Console.ReadLine());
Console.WriteLine("Enter the Second value");
b = int.Parse(Console.ReadLine());
c = a - b;
Console.WriteLine("Subtract is = " + c);
Console.WriteLine("****************************************************");
Console.WriteLine("****************************************************");
Console.WriteLine("Multiplication");
Console.WriteLine("Enter the first value");
a = int.Parse(Console.ReadLine());
Console.WriteLine("Enter the Second value");
b = int.Parse(Console.ReadLine());
c = a * b;
Console.WriteLine("Multiplication is = " + c);
Console.WriteLine("****************************************************");
Console.WriteLine("****************************************************");
Console.WriteLine("Divition");
Console.WriteLine("Enter the first value");
a = int.Parse(Console.ReadLine());
Console.WriteLine("Enter the Second value");
b = int.Parse(Console.ReadLine());
c = a / b;
Console.WriteLine("Divition is = " + c);
Console.WriteLine("****************************************************");
Console.WriteLine("****************************************************");
Console.WriteLine("modules");
Console.WriteLine("Enter the first value");
a = int.Parse(Console.ReadLine());
Console.WriteLine("Enter the Second value");
b = int.Parse(Console.ReadLine());
c = a % b;
Console.WriteLine("modules is = " + c);
Console.ReadLine();
Console.WriteLine();
}
}
}

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
 Find More code samples in C#, ASP.Net, Vb.Net and more Here