We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
public class printfactors { public static void main(String[] args) { printFactors(6); printFactors(32); printFactors(10); printFactors(-1); } public static void printFactors(int number) { if (number < 1) { System.out.println("Invalid Value"); } else { for (int i = 1; i <= number; i++) { if (number % i == 0) { System.out.println(i); //return i; } } } } }
The text was updated successfully, but these errors were encountered:
Looks good and works as desired! Good looks
Sorry, something went wrong.
No branches or pull requests
public class printfactors {
public static void main(String[] args) {
printFactors(6);
printFactors(32);
printFactors(10);
printFactors(-1);
}
public static void printFactors(int number) {
if (number < 1) {
System.out.println("Invalid Value");
}
else {
for (int i = 1; i <= number; i++) {
if (number % i == 0) {
System.out.println(i);
//return i;
}
}
}
}
}
The text was updated successfully, but these errors were encountered: