Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

image text in transcribed

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 hint

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David Kroenke, David Auer, Scott Vandenberg, Robert Yoder

10th Edition

0137916787, 978-0137916788

More Books

Students also viewed these Databases questions