Write a program in Java to input any two
integers and display their HCF.
Answers
Answered by
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
English,
24 days ago
Physics,
24 days ago
Hindi,
24 days ago
Math,
1 month ago
English,
1 month ago
Social Sciences,
9 months ago
Computer Science,
9 months ago
History,
9 months ago