hi
i am writting a prgrame to do the following
generate a random numbers in a given range
count the occurrences of each number and return the total in arry 'a'

find the maximum integer in the arry 'a' of size 's'
find the minimum integer in the arry 'a' of size 's'

and using function to find max and min

this is what i did so far to generate the random numbers and but them in an arry 'a' and the range of the random numbers is less than 20 ,, i include a code to run the programme by pressing r and exit by pressing e ,,,,, but it is not working i dunno why i cant fix the errors if someone can help please

my code ::::

#include <stdlib.h>
#include <stdio.h>
#include <DBOS\LIB.h>
#include <CLIB.h>
int main(void)
{
int range,num,a;

int k;

printf(" *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\n");
printf(" * Please pres r to run or press e to exit *\n");
printf(" *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\n");
k=getch();

/*run by pressing r and exit by pressing e*/


if (k=='r' || k=='R'){ /*accept both lower and upper case */
do{
printf("Enter the range size(max=20)");
scanf("%d",&range);
}
while (range<0 || range>20); /*move to next statment only if the input in range 1 to 20*/

printf("How many numbers do you wish to generate?");
scanf("%d",&num); }
printf("Expected: %d\n", int (num / range));

if (k=='e' || k=='E'){
exit(0);}

date_time_seed();
int my_rand(int range){
int r ;
r=1+rand()%range;
}
void pic(int *a,int range,int num){
int i,t;
t=0;

for(i=0; i<(num); i++)
a[i]=0;
for(i=0; i<num; i++)
{
t=my_rand(range);
a[t]=a[t]+1;

}

}


return(0);
}