CodeItBetter Programming Another VB Programming Blog

How to return Quotient and Remainder for given two numbers

Posted on January 4, 2009
1
2
3
4
5
6
7
8
9
10
'Math - How to return Quotient and Remainder for given two numbers
Option Explicit
 
Public Sub GetQuotientAndRemainder(ByVal iNum1 As Integer, ByVal iNum2 As Integer)
    Dim lQuotient As Long, dRemainder As Double
    lQuotient = Int(iNum1 / iNum2)
    dRemainder = iNum1 - lQuotient * iNum2
    Debug.Print lQuotient
    Debug.Print dRemainder
End Sub
Filed under: Math Leave a comment
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


 

No trackbacks yet.