Social Sciences, asked by subhajitsaha963, 1 month ago

Write a program in Java to input any two
integers and display their HCF.​

Answers

Answered by hrithikamarriahbinoj
0

Answer:

Explanation:

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