Home >>VB.Net Programs >VB.Net program to demonstrate the Math.Log10() method

VB.Net program to demonstrate the Math.Log10() method

Write a VB.Net program to demonstrate the Math.Log10() method

Here, using the Math Class Log10() method, we can find the Log 10 value of the specified number.

Program :

Below is the source code to demonstrate the Math.Log10() method. The program given is compiled and successfully executed.

Example


Module Module1
    Sub Main()
        'Find log value with base e
        Console.WriteLine("Logarithm values:")
        Console.WriteLine(Math.Log10(3))
        Console.WriteLine(Math.Log10(2.34))
        Console.WriteLine(Math.Log10(-2.56))
    End Sub
End Module
	
Output:
Logarithm values:
0.477121254719662
0.369215857410143
NaN

Explanation:

We created a Module1 module in the above program that contains a method Main(). We named Log10() with various specified numbers in the Main() method.

'Find log value with base e
Console.WriteLine("Logarithm values:")
Console.WriteLine(Math.Log10(3))
Console.WriteLine(Math.Log10(2.34))
Console.WriteLine(Math.Log10(-2.56))

Here, the Log10 value of the specified number is identified and the result is displayed on the console screen.


No Sidebar ads