#include <stdio.h>
int
search (int arraytosearch[], int valuetosearch, int size)
{
int i, found;
found = -1;
i = 0;
while (found<0 && i<size)
{
if (arraytosearch[i] == valuetosearch)
found = i;
else
i = i + 1;
}
return (found);
}
int
main (void)
{
int x[] = {12,67,56,60,88,34,123};
int value = 60;
int pos, i;
pos = search (x, value, 7);
if (pos >= 0)
printf ("%d was found at position %d.\n", value, pos);
else
printf ("%d was not found in the array.\n", value);
return (0);
}