C#/C Sharp Math.Pow Example

  C# Projects

C# Math.Pow Example

            double baseNumber, powerNumber;

            Console.Write("Enter base number :");
            baseNumber = Convert.ToDouble(Console.ReadLine());
            Console.Write("Enter exponent number :");
            powerNumber = Convert.ToDouble(Console.ReadLine());

            double returnNumber = Math.Pow(baseNumber, powerNumber);
            Console.WriteLine("{0}^{1} = {2}", baseNumber, powerNumber, returnNumber);

            Console.ReadLine();

C# Math.Pow Example