Generador de números aleatorios en C
#include<stdlib.h>
#include<stdio.h>

int main(int argc, char *argv[])
{
   int a, b;

   if (argc != 3)
   {
      printf("Uso: %s A B\n",argv[0]);
      return 1;
   }

   a = atoi(argv[1]);
   b = atoi(argv[2]);

   srand(time(NULL));

   printf("a=%d, b=%d\n",a,b);
   printf("Números aleatorios distribuidos uniformemente en los intervalos:\n");
   printf("[0,1]       %10lf\n", rand()/(RAND_MAX + 1.0));
   printf("[0,b]       %10lf\n", b*(rand()/(RAND_MAX + 1.0)));
   printf("[a,b]       %10lf\n", a + (b-a)*(rand()/(RAND_MAX + 1.0)));
   printf("[-b/2,b/2]  %10lf\n", b*(rand()/(RAND_MAX + 1.0)) - b/2.0);
   return 0;
}

Updated: