EDIT: I figured it out finally, I actually did need to use a for loop. Here's my solution to my own problem:


System.out.println("Enter a positive integer: ");
int num = input.nextInt();
...