I want to print out an array of those 100 numbers. However, my program stops after generating certain amount of numbers. Here's my code.
class A4
public static void main(String[] args)
{
int[] array1 = new int[101];
int num, i = 0;
boolean repeat = false;
while(i < 100)
{
num = (int) (Math.random() * 100) + 1;
array1[(i)] = num;
for (int e = 0; e < i; e++)
{
if (num == array1[e])
repeat = true;
}
if (repeat == true)
{
continue;
}
array1[i] = num;
System.out.println(array1[i]);
i++;
}
}
}