Computer Science, asked by NirnoyCuber, 11 months ago

Write a program in java to input an integer and print it's factors​

Answers

Answered by sanjeevgautam1358
2

Answer:

hello world is the integer which can be used to print its as a factor

Answered by Anonymous
6

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 + " ");

}

}

}

}

Similar questions