Hi what was wrong with the following program? As i want it to display user input integer value in a range of 1-10, 11-20,21-30 ... 191-200
?
public class Program
{
/**
* This is the main entry point for the application
*/
public static void main(String args[])
{
int a[] = new int[100];
int i = 0;
Scanner in = new Scanner(System.in);
while(i<100)
{
System.out.println("Enter a int");
a[i] = in.nextInt();
displayStatistics(a[i]);
}
}
public static void displayStatistics(integer[] a[i])
{
if(a[i]>=1 && a[i]<=100)
{
i++;
System.out.println(); ----> need to display in range 1-10, 11-20,21-30 ... 191-200
} else {
System.out.println("Integer not in range of 1-200");
}
}
}
int
value to displayStatistics. However the method signature says, the input will be integer array. – Leek