Computer Science, asked by artsarkarss, 3 days ago

enter any two numbers and print the common factors using Java​

Answers

Answered by nmosespaul333
1

Input two number from user, let it be num1 and num2.

Now create a loop which starts from i=1 and ends at i<= minimum of num1 and num2.

Inside Loop if num1%i==0 && num2%i==0 . Print i.

Thank you.

Similar questions