Excellent idea Ankesh.
But it looks like it will give correct results only if intVar1 > intVar2.
Say my requirement is to find the Quotient & reminder for 3 / 8.
I would expect Quotient to be 0 and Reminder to be 3.
But it will return 1 and -5.
so..there is a small correction...i think it will work for all...
But it looks like it will give correct results only if intVar1 > intVar2.
Say my requirement is to find the Quotient & reminder for 3 / 8.
I would expect Quotient to be 0 and Reminder to be 3.
But it will return 1 and -5.
so..there is a small correction...i think it will work for all...
Code:
intVar1 = 3
intVar2 = 8
intQuotient = 0
While intVar1 >= intVar2
intVar1=intVar1-intVar2
intQuotient=intQuotient+1
Wend
msgbox "Quotient=" & intQuotient
msgbox "Reminder=" & intVar1