factors

Solutions on MaxInterview for factors by the best coders in the world

showing results for - "factors"
Sara
25 Jul 2017
1public class Factors {
2
3    public static void main(String[] args) {
4
5        int number = 60;
6
7        System.out.print("Factors of " + number + " are: ");
8        for(int i = 1; i <= number; ++i) {
9            if (number % i == 0) {
10                System.out.print(i + " ");
11            }