15 lines
287 B
C
15 lines
287 B
C
#include <stdlib.h>
|
|
#include <stdio.h>
|
|
|
|
// Generate 1 million random 32-bit integers.
|
|
|
|
int main (int argc, char **argv) {
|
|
rand();
|
|
FILE *ptr = fopen(argv[1], "w");
|
|
int i, n;
|
|
n = atoi(argv[2]);
|
|
for (i = 0; i < n; i++) {
|
|
int x = (int)rand();
|
|
fprintf(ptr,"%i\n", x);
|
|
}
|
|
} |