Write a program that produces 20 random numbers between 1 and 20. The program should store all nonduplicate values in an array.
Use the smallest possible array to accomplish this task.
I can get the numbers generated no problem however, i can't get my program to check against the array to se if the value has been stored or not...
Here is my code thus far:
Code tags added by Hammer.
#define val 20 /*variable to be stored in the array*/
for ( i = 1; i <= 20; i++ )
x = 1 + (rand() % 20);