Write a C program Gen.c that generates a ordered sequence of 20 random numbers within a range of 1000 to 9999. The program is invoked by a command line
% gen datfile1
In the above line, gen is the executable, datfile1 is the argument to the execution of gen. It specifies the name of the output file for the 20 random numbers.
To make Gen.c possible, your main() program should accept arguments like
#include
void main (int argc, char *argv[])
{
char *fname = argv[1];
....
fp = fopen(fname,"w");
....