VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Calculate hcf of any 2 numbers

by Sachin Tiwari (3 Submissions)
Category: Math/Dates
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Fri 2nd February 2007
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Calculate hcf of any 2 numbers

API Declarations


dim b as single

Rate Calculate hcf of any 2 numbers



b = Text2.Text
If a >= b Then
For i = 1 To b
If a Mod i = 0 And b Mod i = 0 Then
c = i
End If
Next i
Print c
End If
If b >= a Then
For i = 1 To a
If a Mod i = 0 And b Mod i = 0 Then
c = i
End If
Next i
Print c
End If
End Sub

Download this snippet    Add to My Saved Code

Calculate hcf of any 2 numbers Comments

No comments have been posted about Calculate hcf of any 2 numbers. Why not be the first to post a comment about Calculate hcf of any 2 numbers.

Post your comment

Subject:
Message:
0/1000 characters