Home »
VB.Net »
VB.Net Programs
VB.Net program to demonstrate the use of Math.IEEERemainder() method
By Nidhi Last Updated : November 14, 2024
Math.IEEERemainder() method in VB.Net
Here, we will find the remainder from two specified numbers of double type using the IEEERemainder() method of Math class.
VB.Net code to demonstrate the use of Math.IEEERemainder() method
The source code to demonstrate the use of Math.IEEERemainder() method is given below. The given program is compiled and executed successfully.
'VB.Net program to demonstrate the use of
'Math.IEEERemainder() method.
Module Module1
Sub Main()
Dim num1 As Double = 0
Dim num2 As Double = 0
Dim remainder As Double = 0
Console.Write("Enter the number1: ")
num1 = Double.Parse(Console.ReadLine())
Console.Write("Enter the number2: ")
num2 = Double.Parse(Console.ReadLine())
remainder = Math.IEEERemainder(num1, num2)
Console.WriteLine("Remainder : {0}", remainder)
End Sub
End Module
Output:
Enter the number1: 5.25
Enter the number2: 2.1
Remainder : 1.05
Press any key to continue . . .
Explanation:
In the above program, we created a module Module1 that contains a method Main(). In the Main() method, we created three variables num1, num2, and remainder that are initialized with 0.
Console.Write("Enter the number1: ")
num1 = Double.Parse(Console.ReadLine())
Console.Write("Enter the number2: ")
num2 = Double.Parse(Console.ReadLine())
Here, we read the value of num1 and num2 variables from user.
remainder = Math.IEEERemainder(num1, num2)
Console.WriteLine("Remainder : {0}", remainder)
Here, we calculated the remainder using IEEERemainder() and print the result on the console screen.
VB.Net Basic Programs »