lundi 25 juillet 2016

Random list of numbers

#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <math.h>

int main()
{
   int i;
   int diceRoll;

   for(i=0; i < 20; i++)
   {
       printf("%d \n", rand());
   }

    return 0;
}

This is the code I wrote in c++ (codeblocks) to get random numbers, the problem is I always get the same sequence: 41,18467,6334,26500 etc...

I'm still learning so please try to explain like you're talking with a 8 year old D:




Aucun commentaire:

Enregistrer un commentaire