Menu
Question Index
...


Write a program to calculate the LCM of two numbers.

Input(First Number, Second Number) Output
132, 154 924
56, 80 560
12, 18 36

class CalculateLCM

{    public static void main(String s[])
    {
        int result = calculateLcm( 14, 28 );
        System.out.println("The Lowest Common Multiple is " + result);

    }


public static int calculateLcm(int first, int second)
{
int result = 0;
//Write a code here to calculate the LCM of two numbers and assign it to result.
return result;
}
}

Doubts

Problems

Topic: Java for loops vs Java while loops vs Java do while loops

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App