Skip to content

Instantly share code, notes, and snippets.

@carbonrobot
Created August 21, 2015 01:14
Show Gist options
  • Save carbonrobot/2328bf8dc702af77f0ef to your computer and use it in GitHub Desktop.
Save carbonrobot/2328bf8dc702af77f0ef to your computer and use it in GitHub Desktop.
Randomness
package com.company;
public class Main {
public static void main(String[] args) {
int range = 100;
for(int i = 1; i <= 20; i++){
int number = (int)(range * Math.random()) + 1;
System.out.format("%-10s", number);
if(i % 5 == 0){
System.out.println("");
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment