/**
 * Program to print random numbers 
 */

public class Rand
{

    public static void main (String[ ] args)
    {        
        int rand;                                   //create a local variable
 
        rand = (int) (Math.random( ) * 6 );         //random number from 0 to 5
        System.out.println(rand);


        rand = (int) (Math.random( ) * 6 );         //random number from 0 to 5
        rand = rand + 1;                            //make it from 1 to 6
        System.out.println(rand);


        rand = (int) (Math.random( ) * 6 );         //random number from 0 to 5
        rand = rand + 11;                           //make it from 11 to 16
        System.out.println(rand);

                                                    //I want random from 10-20
        rand = (int) (Math.random( ) * 11);         //random number from 0 to 10
        rand = rand + 10;                           //make it from 10 to 20
        System.out.println(rand);

                                                    //I want random from 10-20
        rand = (int) (Math.random( ) * (20-10+1) ); //random number from 0 to 10
        rand = rand + 10;                           //make it from 10 to 20
        System.out.println(rand);
   

        int min = 10;
        int max = 20;
 
        rand = (int) (Math.random( ) * (max-min+1) );   //number from 0 to max-min
        rand = rand + min;                              //add the minimum value
        System.out.println(rand);
  
    }
}