C# Program to Find the Division of Exponents of Same Base

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Collections;

using System.Threading;

using System.IO;


namespace CSharpProgram

{

    class AkbTechie

     {

            static void Main(string[] args)

           {

               double Base, exp1, exp2, Div,Result;

                Console.WriteLine("Enter the Base : ");

                Base = double.Parse(Console.ReadLine());

               Console.WriteLine("Enter the First Exponent :");

                exp1 = double.Parse(Console.ReadLine());

               Console.WriteLine("Enter the Second Exponent :");

                exp2 = double.Parse(Console.ReadLine());

                Div = exp1 - exp2;

                Result = Math.Pow(Base, Div);

                Console.WriteLine("Result is : {0}^{1} : {2}", Base, Div, Result);

               Console.ReadLine();

               Console.ReadKey(); 

          }

    }

}

Output:-

Enter the Base :

3

Enter the First Exponent :

5

Enter the Second Exponent :

2

Result is : 3^3 : 27

एक टिप्पणी भेजें

0 टिप्पणियाँ