Advertisement
alduncin

aleatorio.c

Jul 1st, 2013
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.30 KB | None | 0 0
  1. //de 0 a 1, muestra de 100 numeros
  2. #include <stdlib.h>
  3. #include <time.h>
  4. int main(int argc, char** argv[])
  5. {
  6.   float numero=0;
  7.   int N=100,i;//100
  8.   //  N=(int)argv[1];
  9.   srand (time (NULL));
  10.   for(i=0;i<N;i++){
  11.   numero =  ((0-1)*((float)rand()/RAND_MAX))+1;
  12.   printf(" %f \n",numero);
  13.   }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement