+ 1
Write the java program to find LCM
2 Answers
+ 2
// Java
import java.util.Scanner;
public class Program
{
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int num = in.nextInt();
int result = 0;
for(int i = 1; i < num; i++){
if(num%i==0){
result = i;
}
}
System.out.print("LCM: "+result);
}
}