Computer Science, asked by rinkipaulghosh, 8 months ago

Write a program to find the factors of 60 in Java

Answers

Answered by susmithapakkala
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 Anonymous
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