rpaulson
Well-known Member
- Joined
- Oct 4, 2007
- Messages
- 1,428
Looking for some code that will return the closes 2 numbers that are factors of a given number.
given number 12: the 2 factor that are the closest to each other are 3 & 4 (not 2 & 6)
24 would return 6 & 4 (not 8 & 3 or 2 & 12)
64 would return 8 & 8 (not 16 & 4)
90 would be 9 & 10
37 would return 1 & 37
....
ex:
x= input(Type your number)
...code...
msgbox ("highest factors are " & F1 & " and " & F2)
Thanks for looking
Ross
given number 12: the 2 factor that are the closest to each other are 3 & 4 (not 2 & 6)
24 would return 6 & 4 (not 8 & 3 or 2 & 12)
64 would return 8 & 8 (not 16 & 4)
90 would be 9 & 10
37 would return 1 & 37
....
ex:
x= input(Type your number)
...code...
msgbox ("highest factors are " & F1 & " and " & F2)
Thanks for looking
Ross