#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
srand(time(NULL));
int i = 0;
int dizi[20];
for (i = 0; i < 20; i++) {
dizi[i] = rand() % 20;
}
for (i = 0; i < 20; i++) {
printf("%d\n", dizi[i]);
}
return 0;
}
Is the if else structure sufficient to solve this problem or do I need to do something about the rand function?
Aucun commentaire:
Enregistrer un commentaire