I am having a logic error with this code. I need to get ten int inputs from the user and then print out any number bigger than 10. The only problem is that if the very last number in the array is bigger than 10 it will not print.
public class Bigger10
{
public static void main(String[] args)
{
System.out.println("Please enter 10 integer numbers");
int[] num = new int[10];
int count = 0;
int num1 = StdIn.readInt();
while(count<9)
{
num[count] = num1;
count++;
num1 = StdIn.readInt();
}
for(int i = 0;i<count;i++)
{
if(num[i]>10)
{
System.out.printf("%d ", num[i]);
}
}
}
}
for(int i = 0;i<count;i++)change it toi<=count