I am working on a program to have a user input two positive integers and then finding the greatest common denominator between the two. My problem is, I don't know how to display the number (num2) that is returned after the method. Putting a simple System.out.println gives me the error "unreachable code". Any thoughts would be greatly appreciated. Thank you in advance!
You have a method to determine the largest common denominator, but are never calling it. Also, you should be printing the result from the main method, not the method running the algorithm. For example:
posted 6 years ago
Thank you all, got it! Now once I figure out how to validate whether or not the entered values are integers and not doubles/other characters I'll be good to go! Off to search...
What could go wrong in a swell place like "The Evil Eye"? Or with this tiny ad?
Devious Experiments for a Truly Passive Greenhouse!