Code generating unwanted '0'
I've written this piece of code
for (int i=0; i<array.length-2; i++)//assigning random numbers to the array
{
array[i] = ( (int)(Math.random() * lastNumber + 1));
}
And I do not want it to generate the number 0 but it does. Can somebody please tell me where I went wrong? I thought even if Math.random produces a 0 and * it with lastNumber, it would still + 1 in the end but I still keep getting the number 0 generated especially in my second last and last array space.
lastNumber is defined by the user.
Thanks in advance to all who extend their assistance.>

