Any ideas on how to generate a random number between 2 and 100 in C Programming Language? I tried:
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int randomNums (int m, int n)
{
srand ((unsigned) time(NULL));
m = rand () % 99 + 2;
n = rand () % 99 + 2;
return m, n;
}
But it doesn't seem to be working.
Aucun commentaire:
Enregistrer un commentaire