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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started