Write a program to find the factors of 60 in Java
Answers
Answered by
1
Answer:
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 + " ");
}
}
}
Explanation:
Answered by
0
Answer:
The quickest way to find the factors of a number is to divide it by the smallest prime number (bigger than 1) that goes into it evenly with no remainder. Continue this process with each number you get, until you reach 1.
Similar questions
Math,
5 months ago
Science,
5 months ago
Physics,
11 months ago
English,
11 months ago
Political Science,
1 year ago