write a program in Java to accept four numbers and find the LCM HCF of the four numbers
Answers
Answered by
8
hope this will help u
/* Java Program Example - Find HCF LCM of Two Numbers */
import java.util.Scanner; public class
JavaProgram { public static void main(String args[])
{ int a, b, x, y, t, hcf, lcm; Scanner scan = new Scanner(System.in);
System.out.print("Enter Two Number : "); x = scan.nextInt();
y = scan.nextInt();
a = x; b = y; while(b != 0)
{ t = b; b = a%b; a = t; }
hcf = a; lcm = (x*y)/hcf;
System.out.print("HCF = " +hcf); System.out.print("\nLCM = " +lcm); } }
plz mark brainiest
#neymarjr3
/* Java Program Example - Find HCF LCM of Two Numbers */
import java.util.Scanner; public class
JavaProgram { public static void main(String args[])
{ int a, b, x, y, t, hcf, lcm; Scanner scan = new Scanner(System.in);
System.out.print("Enter Two Number : "); x = scan.nextInt();
y = scan.nextInt();
a = x; b = y; while(b != 0)
{ t = b; b = a%b; a = t; }
hcf = a; lcm = (x*y)/hcf;
System.out.print("HCF = " +hcf); System.out.print("\nLCM = " +lcm); } }
plz mark brainiest
#neymarjr3
Answered by
3
Answer:
this is wrong answer because it has been. asked four and you have done four
Similar questions