Arithematical Operators C# with Example



Arithematical Operators C# with Example

 using System;

namespace CSharpFundamentals
{
    class ArithmeticalOperators
    {
        private static void Main(string[] args)
        {
			double value1, value2;
			Console.Write("Enter First Value: ");
			value1 = Convert.ToDouble(Console.ReadLine());
			
			Console.Write("Enter Second Value: ");
			value2 = Convert.ToDouble(Console.ReadLine());
			
			Console.WriteLine();
			
			Console.WriteLine("Addition: {0} + {1} = {2}", value1, value2, value1+value2);
			Console.WriteLine("Subtraction: {0} - {1} = {2}", value1, value2, value1-value2);
			Console.WriteLine("Multiplication: {0} * {1} = {2}", value1, value2, value1*value2);
			Console.WriteLine("Division: {0} / {1} = {2}", value1, value2, value1/value2);
			Console.WriteLine("Reminder: {0} % {1} = {2}", value1, value2, value1%value2);
        }
    }
}
 

0 Comment's

Comment Form

Submit Comment