/*
 These program shows an example of
 how to obtain a random real number.
 */
#include <stdio.h>
#include <stdlib.h>
#include <time.h>


int flip(void);

int main ()
{
    //  Seed the random number generator
    (void) srand (time (NULL));
    
    //  Show the max random number
    printf("RAND_MAX=%d \n", RAND_MAX);
    
    
    // Generate 10 random (real) numbers in the range min..max
    double min = 5.0, max = 7.0;
    double range = max - min;
    
    for (int count = 0; count < 10; count++)
    {
        double r1 = ((double) rand() / (double) RAND_MAX) * range;
        double r2 = r1 + min;
        
        printf("Random real=%.2f\n", r2);
    }
    
    return 0;
}

