All Arithmetical Operators in C# Console Programing

  1. using System;  
  2. namespace CSharpFundamentals  
  3. {  
  4.    class ArithmeticalOperators  
  5.    {  
  6.       private static void Main(string[] args)  
  7.       {  
  8.          double value1, value2;  
  9.          Console.Write("Enter First Value: ");  
  10.          value1 = Convert.ToDouble(Console.ReadLine());  
  11.          Console.Write("Enter Second Value: ");  
  12.          value2 = Convert.ToDouble(Console.ReadLine());  
  13.          Console.WriteLine();  
  14.          Console.WriteLine("Addition: {0} + {1} = {2}", value1, value2, value1+value2);  
  15.          Console.WriteLine("Subtraction: {0} - {1} = {2}", value1, value2, value1-value2);  
  16.          Console.WriteLine("Multiplication: {0} * {1} = {2}", value1, value2, value1*value2);  
  17.          Console.WriteLine("Division: {0} / {1} = {2}", value1, value2, value1/value2);  
  18.          Console.WriteLine("Reminder: {0} % {1} = {2}", value1, value2, value1%value2);  
  19.       }  
  20.    }  
  21. }