enter any two numbers and print the common factors using Java
Share
enter any two numbers and print the common factors using Java
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Verified answer
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.