Question

Write a recursive function moreFactors(a,b,fact) that does the following: 1. Takes as an input 3 positive...

Write a recursive function moreFactors(a,b,fact) that does the following:
1. Takes as an input 3 positive integers. (1 pts)
2. Of the two integers a and b, the function returns the integer that has the most factors fact. (5 pts)
3. If both integers a and b have the same amount of factors fact, the function will return the larger integer. (2
pts)
Test your function with the following: (2 pts)
>> result=moreFactors(24,32,3)
result =
24
(24 = 31 23, 32 = 25)
>> result=moreFactors(32,24,3)
result =
24
>> result=moreFactors(80,168,2)
result =
80
(80 = 24 5, 168 = 23 3 7)
>> result=moreFactors(100,50,5)
result =
100
(100 = 22 52, 50 = 2 52)
Note: Your function must be recursive! If your function does not use recursion, up to 8 points may be deducted from
your total.

0 0
Add a comment Improve this question Transcribed image text
Know the answer?
Add Answer to:
Write a recursive function moreFactors(a,b,fact) that does the following: 1. Takes as an input 3 positive...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT