You are given an array say A[n] and you are supposed to search an element say 'x' in the array if it exists or not.
Algorithm:
Loop through length of array
Check at each index if the element is found or not
End Loop
Program:
int i;
for( i = 0; i <= n-1; i++ )
{
if( A[i] == x )
{
printf("Element Found at position: " + i ) ;
break ;
}
}
if( i == n )
{
printf("Element Not Found in the Array..!") ;
}