I'm going to guess that you want just one answer from your search, not a bunch of -1's for instance.
int main (void)
printf("Enter 8 floating point numbers: \n");
for (numbers = 0; numbers < 8; numbers++)
printf("Enter the number to be searched: \n");
for (x = 0, match = 0; x < 8; x++)
if (ary[x] == input)
match = x;
if(match > 0)
printf("Match found at index %d\n", x);
printf("-1. No match was found\n");
Something like the above change?
Note that this will only give you the last index number that matches, not all of the matching indexes. Do you want all the matching indexes?