lundi 13 novembre 2017

How to get random number of random number?

I have a question related random number.

Write C program to print a random number of random numbers. Your program should accept two command-line parameters. The first is the upper bound for each random number. The second is the upper bound for the number of numbers to print. For instance, your program may be called as follows:

        ./randomlist 6 4

Given this command-line, your program should print between 1 and 4 numbers, each of which lies in the range 0–6.

Could you please help me to explain this question ? So how we get value from command-line? And how we set 4 for rand() ? and the last one is how we set the number from 0 to 6?

Thanks.




Aucun commentaire:

Enregistrer un commentaire