How do you do this? I can assign each random values into arrays, but I cannot increment the value so that I can display each values with another for loops. It needs to be 5 to the right..
import java.util.Scanner;
import java.util.Random;
public class LabAssgn_laksmono
{
public static void main(String args[])
{
Scanner input = new Scanner(System.in);
Random r = new Random();
int user;
do
{
System.out.print("Enter input between 10 to 100: ");
user = input.nextInt();
}
while(user > 100 || user < 10);
int array[] = new int [user];
int values;
for(int i = 0 ; i < array.length ; i++)
{
values = r.nextInt(100) + 1;
array[i] = values;
for (int j = 1; j <= 5; j++)
{
System.out.printf("%d ", values);
}
System.out.println();
}
}
}
thanx for the help... :sad: