Home
DevCentral
Search
Configure Global Search
Log In
Transactions
P110
Change Details
Change Details
Old
New
Diff
#include <stdio.h> #include <stdlib.h> int aleatoire (int borne_1, int borne_2) { int nombre; nombre = rand() % ((borne_2 - borne_1) + 1) + borne_1; return nombre; } void initialize () { srand((unsigned int)time(NULL)); } void printRandomValues (int count, int borne_inf, int borne_sup) { int i; for (i = 0 ; i < count ; i++) { printf("%d\n", aleatoire(borne_inf, borne_sup)); } } int main () { initialize() printRandomValues(10, 1000, 1500); }
#include <stdio.h> #include <stdlib.h> int aleatoire (int borne_1, int borne_2) { int nombre; nombre = rand() % ((borne_2 - borne_1) + 1) + borne_1; return nombre; } void initialize () { srand((unsigned int)time(NULL)); } void printRandomValues (int count, int borne_inf, int borne_sup) { int i; for (i = 0 ; i < count ; i++) { printf("%d\n", aleatoire(borne_inf, borne_sup)); } } int main () { initialize() printRandomValues(10, 1000, 1500); }
Continue