Programming Code Center(PCC)
[JAVA]

(PCC)::[How-to-write-Java-Program-to-Display-Factors-of-a-Number]::[java]

File Name : Factors.java

//Example: Factors of a Positive Integer
public class Factors {

    public static void main(String[] args) {

        int number = 60;

        System.out.print("Factors of " + number + " are: ");
        for(int i = 1; i <= number; ++i) {
            if (number % i == 0) {
                System.out.print(i + " ");
            }
        }
    }
}

Output :

Factors.jpg