Friday, 1 December 2017

C# Program to Perform Division of Exponents of Same Base


Code:

using System;
class Program
{
    static void Main()
    {
        Console.WriteLine("Enter the Base : ");
        double num = double.Parse(Console.ReadLine());
        Console.WriteLine("Enter the First Exponent :");
        double exp1 = double.Parse(Console.ReadLine());
        Console.WriteLine("Enter the Second Exponent :");
        double exp2 = double.Parse(Console.ReadLine());
        double div;
        div = exp1 - exp2;
        Console.WriteLine("Result is : {0}^{1} : {2}", num, div, Math.Pow(num, div));
        Console.ReadLine();
    }
}


Output:

Enter the Base :
2
Enter the First Exponent :
4
Enter the Second Exponent :
3
Result is : 2^1 : 2


More C# Programs:




















100+ Best Home Decoration Ideas For Christmas Day 2019 To Make Home Beautiful

Best gifts for Christmas Day | Greeting cards for Christmas Day | Gift your children a new gift on Christmas day This Christmas d...