Answered step by step
Verified Expert Solution
Question
1 Approved Answer
write code in Java Task 3: Loops public static int ged(int a, int b) Given two positive integers a and b, find and return the
write code in Java
Task 3: Loops public static int ged(int a, int b) Given two positive integers a and b, find and return the greatest common divisor. This is the largest number that evenly divides both inputswith no remainder. (It cannot be larger than the smaller of the two numbers). public static int lcm(int a, int b) Given two positive integers a and b, find and return the least common multiple. This is the smallest number that can be divided by the two inputs evenly with no remainder. (It cannot be smaller than either of the two numbers) . Hint: the least common multiple can be calculated quickly as: 1cm(a, b) la*bl / gcd(a, b) = Manual Inspection Criteria(5%) Use the approach in the hintStep 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