I am trying to generate random numbers between 2 and 11, here is my code:
srand(time(NULL));
int card;
card = rand() % 11 + 2;
However, currently my code is creating numbers from 2-12. How could I solve this so that it creates numbers from 2-11?
Aucun commentaire:
Enregistrer un commentaire