Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package lista.Alapok;
- public class Main {
- public static void printFactors(int number) {
- if(number<1) System.out.println("Invalid Value");
- if (number > 0) {
- for (int i = 1; i <= number; i++) {
- if (number % i == 0) {
- System.out.println(i);
- }
- }
- }
- }
- public static void main(String[] args) {
- printFactors(100);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement