// Exercise3_10: Find smallest factors of an integer public class Exercise3_10 { // Main method public static void main(String args[]) { // Read the integer System.out.print("Enter an integer : "); int number = MyInput.readInt(); // Find all the smallest factors of the integer System.out.println("The factors for " + number + " is"); int factor = 2; while (factor <= number) { if (number%factor == 0) { number = number/factor; System.out.println(factor); } else { factor++; } } } }