Trinket is closing down in August, but don't worry we will be moving our projects to the free offer from GoCodeIt.
What is the LCM of two numbers?
The lowest common multiple (LCM) is the lowest multiple shared by two or more numbers. For example, for the numbers 2 and 5, the lowest common multiple is 10 - the number both numbers can multiply into without a remainder.
Write a program that outputs the LCM of two numbers input.
Use this boilerplate code as a starting point:
Remember to add a comment before a subprogram, selection or iteration statement to explain its purpose.
Enter the first number: 2
Enter the second number: 5
The LCM of 2 and 5 is 10.
Enter the first number: 6
Enter the second number: 4
The LCM of 6 and 4 is 12.
Enter the first number: 7
Enter the second number: 40
The LCM of 7 and 40 is 280.
Enter the first number: 2
Enter the second number: 10
The LCM of 2 and 10 is 10.
Use these resources as a reference to help you meet the success criteria.
Run the unit tests below to check that your program has met the success criteria.
Enter the first number: 2
Enter the second number: 4
The LCM of 2 and 4 is 4.
Enter the first number: 8
Enter the second number: 8
The LCM of 8 and 8 is 8.
Enter the first number: 6
Enter the second number: 4
The LCM of 6 and 4 is 12.
Enter the first number: 8
Enter the second number: 10
The LCM of 8 and 10 is 40.
Enter the first number: 16
Enter the second number: 72
The LCM of 16 and 72 is 144.
Check that you have: