Simple java program, need help
I'm trying to write a Java program that asks the user for how many numbers they want to enter, and will then ask them for that many numbers. For each number (after the first one), then will print whether it is bigger than, smaller than, or the same as the number that came before. It keeps comparing the new number to the original number 1 instead of the previous number. Any suggestions on what is wrong?
import java.util.*;
import java.text.*;
public class proj3
{
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
System.out.print("How many numbers? ");
int num = Integer.parseInt(s.nextLine());
System.out.println();
int count = 1;
System.out.print("Enter number 1: ");
int prevnum = Integer.parseInt(s.nextLine());
System.out.println();
while (count < num) {
System.out.print("Enter number " + (count +1) + ": ");
int currnum = Integer.parseInt(s.nextLine());
if (currnum > prevnum){
System.out.println(currnum + " is bigger than " + prevnum);
count = count + 1;
currnum = prevnum;
}
else if (currnum< prevnum){
System.out.println(currnum + " is smaller than " + prevnum);
count = count + 1;
currnum = prevnum;
System.out.println();
}
else {
System.out.println(currnum + " is the same as " + prevnum);
count = count + 1;
currnum = prevnum;
System.out.println();
}
}
}
}