Question: This question will test the basic ability to use expressions, conditionals, and loops in solving a simple (but manually intensive) problem. Write a program that
This question will test the basic ability to use expressions, conditionals, and loops in solving a simple (but manually intensive) problem.
Write a program that reads in two numbers and outputs the sum of all the factors that are in both numbers.
For example, the integer 24 has the factors 1,2,3,4,6,8,12,24 and the integer 30 has the factors 1,2,3,5,6,10,15,30. So, 24 and 30 have the factors 1,2,3,6 in common and the sum is then 1+2+3+6=12.
Hence if the input were 24 and 30 then the output would be 12.
Question: What is the common factor sum with input 21231210 and 39916800?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
