.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Code Snippets >> Visual Studio >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

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();
        }
    }
}



     

Further Readings:

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

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend