//JAVA Program to find HCF & LCM of two numbers
package Diploma;
import java.util.Scanner;
public class HCFLCM
{
public static void main(String args[]){
int temp1, temp2, num1, num2, temp, hcf, lcm;
Scanner scanner = new Scanner(System.in);
System.out.print("Enter First Number: ");
num1 = scanner.nextInt();
System.out.print("Enter Second Number: ");
num2 = scanner.nextInt();
scanner.close();
temp1 = num1;
temp2 = num2;
while(temp2 != 0)
{
temp = temp2;
temp2 = temp1%temp2;
temp1 = temp;
}
hcf = temp1;
lcm = (num1*num2)/hcf;
System.out.println("HCF = "+hcf);
System.out.println("LCM = "+lcm);
}
}
Affordable Samsung 19"" Flat in UAE, 1366x768 LED Monitor in UAE
ReplyDeletehttps://gccgamers.com/gaming-vr.html/samsung-19-flat-1366x768-monitor-ls19a330nhmxue.html