Hello,I posted a topic on this earlier.Got some tips that helped but need some more assistance.The problem is to create an array of 100 random integers in the range 1 to 200 and then using the sequential search,searches the array 100 times using randomly generated targets in the same range.At the end of the program the number of searches completed, the number of successful searches, the percentage of successful searches and the average number of tests per search is to be displayed.
I already have the array created with 100 random integers and the code is below.I'm having problems with the rest part of the program, ie the successful searches, etc.
Any ideas and hints will be appreciated.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define ARY_SIZE 200
main ()
{
int randoms[100];
int i;
int j;
int range;
for(i = 0; i < 100; i++)
{
randoms[i] = rand() % 200;
printf(" %d", randoms[i]);
}