Urgent Case! - the best combination of dividers '22' and '30' which divide a certain number with the smallest remainder
Hi,
Urgently Can I have some VB code so that if I enter a certain number, say '203', then the program can find out
the best combination of dividers '22' and '30' with the smallest remainder'
Example:
I need '30' and '22' to be my divider
30 and 22 must be used for calculation
0
starstarhkAuthor Commented:
the remainder must be the smallest in all cases of combinations
0
Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.
the number '30' doesn't have a priorty that the myvalue must not be always divided by it first.
The system must analyze in which combination is the best with the smallest remainder or no remainder
>>the number '30' doesn't have a priorty that the myvalue must not be always divided by it first.
of course, you can put 30 and 22 into variables, in order to meet your requirement
0
starstarhkAuthor Commented:
how about if the input day is '67'
The best combination should be '22 * (3)' with remainder '1'
but the program generated '30 * (2)' with remainder '7'
I want to have combination of dividers '22' and '30' and this time I want to avoid any remainder..
for example if the input is 23, then the old answer is that remainder is 1,
Now I want it to become 30, then if the input is 31, then I want it to become '22x2' = 44
......
so if the input is 206, then the answer should be 22x8+30 = 206
then if the input is 205, then the answer still should be 22x8+30 = 206
The criteria is that I need to have a combination with no remainder which is the closest to the input number.
thanks for your help !
If I want to sort a list of numbers, which sorting is good?
I want to find the smallest number among a set of number from an array?
Can u teach me how?
Lowest = Arr(0)
For i = 1 to NumberOfRecordsInArray
If Arr(i) < Lowest Then Lowest = Arr(i)
Next
Msgbox "Lowest number in array: " & Lowest
0
Featured Post
Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.
201x1+1x1