import java.util.*;
import java.lang.*;
import java.io.*;

// The main method must be in a class named "Main".
class Main {
    public static void main(String[] args) {

        // Declare total pool size and number of random samples to be generated
        int var_total = 1788; // Total Pool size
        int var_gen_sample = 10; // samples to be generated
        
        if (var_total > var_gen_sample) {
            
            int var_sample_interval = var_total / var_gen_sample;
    		
    		//int var_rStart = rand() * (var_sample_interval - 1) + 1;
    		Random random = new Random();
    		int var_rStart = random.nextInt(var_sample_interval);
    		
    		int var_nextStop = var_rStart;
    		int var_count = 0;
    		int var_rCount = 0;
    		
    		System.out.println(    
                "Total: "+var_total
                + "\tStart: "+var_rStart 
                + "\tSample Interval: "+ var_sample_interval
                );
    		
    		System.out.println("====================================================\n");
    		
    		do {
    		    var_count = var_count + 1;    
    		    if (var_count == var_nextStop) {
    		        var_nextStop = var_nextStop + var_sample_interval;
    		        var_rCount = var_rCount + 1;
    		        System.out.println(var_rCount+":\t"+var_count);
    		        
    		    }
    		    
    		} while (var_rCount < 20);
            
        }
    }
}

Embed on website

To embed this program on your website, copy the following code and paste it into your website's HTML: