Write a c program genc that generates a ordered


Q1. 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"); 
.... 

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Write a c program genc that generates a ordered
Reference No:- TGS0814283

Now Priced at $30 (50% Discount)

Recommended (91%)

Rated (4.3/5)