Computer Science, asked by radhasingh8981, 6 months ago

Write a program in Java to show HCF and LCM of three numbers with Scanner​

Answers

Answered by BearKnight
3

Answer:

class lcmGCD. { public static void main(String args[])

{ int n1,n2; int gcd,lcm,remainder,numerator,denominator;

Scanner sc = new Scanner(System. in); System. ...

n2=sc. nextInt(); if (n1>n2) ...

numerator=n1; denominator=n2; }

else. { numerator=n2;

denominator=n1; } remainder=numerator%denominator;

while(remainder!=0)

Similar questions