Q:

C# program to print the edge values using Pow() method

belongs to collection: C# Basic Programs | basics

0

C# program to print the edge values using Pow() method

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Program:

The source code to print the edge values using Pow() method is given below. The given program is compiled and executed successfully on Microsoft Visual Studio.

//C# program to check the edge values in Pow() method. 

using System;

class Edge
{
    static void Main()
    {
        double number1 = 0;
        double number2 = 0;
        double number3 = 0;
        double number4 = 0;

        number1 = Math.Pow(double.PositiveInfinity, 2);
        number2 = Math.Pow(double.NegativeInfinity, 2);
        number3 = Math.Pow(double.MinValue, 0);
        number4 = Math.Pow(double.NaN, 2);
        
        Console.WriteLine("Number1 : {0}", number1);
        Console.WriteLine("Number2 : {0}", number2);
        Console.WriteLine("Number3 : {0}", number3);
        Console.WriteLine("Number4 : {0}", number4);
    }
}

Output:

Number1 : Infinity
Number2 : Infinity
Number3 : 1
Number4 : NaN
Press any key to continue . . .

Explanation:

Here, we created a class Edge that contains the Main() method. The Main() method is the entry point for the program. Here we declared 4 variables of the double type that are initialized with 0 and then find the edge's values of numbers using Pow() method of Math class and print the result on the console screen.

 

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

C# Basic Programs | basics

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
C# program to calculate the fractional power of nu... >>
<< C# program to calculate the multiplication of two ...