#include <stdio.h>
#include <stdlib.h>
#include <time.h>

double rand01();
int randDado();
int main()
{
 
   int i; 
     
   srand(time(NULL));
   
   for(i=0;i<10;i++)
      printf("Numero casuale tra 0 e 1: %.5f\n", rand01());
   for(i=0;i<10;i++)
      printf("Tiro un dado ed esce: %d\n", randDado());
 
   fflush(stdin);
   getchar();
   return 0;
}

double rand01()
{
   return ((double) rand())/RAND_MAX;
}

int randDado()
{
   return rand()%6 +1;
}