Skip to content

Instantly share code, notes, and snippets.

@arielmagbanua
Created September 16, 2021 08:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arielmagbanua/cbf739e03c3ef18b9f11b2554d00c683 to your computer and use it in GitHub Desktop.
Save arielmagbanua/cbf739e03c3ef18b9f11b2554d00c683 to your computer and use it in GitHub Desktop.
Factors of a Number

Factors of a Number

Write a Java program to accepts an integer and count the factors of the number.

Starter Code

public class App {
    public static void main(String[] args) throws Exception {
        // scanner
        Scanner scanner = new Scanner(System.in);

        // get the input number

        // determine how many factors

        scanner.close();
    }
}

Output

Enter an integer: 25                                                   
3
Enter an integer: 30
8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment