ADVERTISEMENT

ADVERTISEMENT

ADVERTISEMENT

VB.Net program to demonstrate the use of Math.IEEERemainder() method

Here, we are going to demonstrate the use of Math.IEEERemainder() method in VB.Net.
Submitted by Nidhi, on December 02, 2020

Here, we will find the remainder from two specified numbers of double type using the IEEERemainder() method of Math class.

Program/Source Code:

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 »



ADVERTISEMENT



ADVERTISEMENT



Comments and Discussions

ADVERTISEMENT

ADVERTISEMENT

ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT

Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.