C# Program to Perform Multiplication 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 Num, Exp1, Exp2,Mul;

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

                Num = Convert.ToDouble(Console.ReadLine());

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

                Exp1 = Convert.ToDouble(Console.ReadLine());

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

                Exp2 = Convert.ToDouble(Console.ReadLine());

                Mul = Exp1 + Exp2;

                Console.WriteLine("Result is : {0}^{1} : {2}", Num, Mul, Math.Pow(Num, Mul));

               Console.ReadKey();

          }

    }

}


Output:-

Enter the Base :

2

Enter the First Exponent :

3

Enter the Second Exponent :

2

Result is : 2^5 : 32

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

0 टिप्पणियाँ