Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- import java.security.SecureRandom;
- public class NumGenerator
- {
- public static void main(String[] args)
- {
- int[] numArray = new int[10];
- for ( int index = 0; index < numArray.length; index++)
- {
- numArray[index] = (int)(Math.random()*100);
- }
- for ( int index = 0; index < numArray.length; index++)
- {
- System.out.println(numArray[index]);
- }
- Scanner input = new Scanner(System.in);
- System.out.println("Please enter a number between 0-100");
- int num = input.nextInt();
- for ( int index = 0; index < numArray.length; index++)
- {
- if(numArray[index] > num)
- {
- System.out.println(numArray[index]);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement