Final answer:
When an element is found in an array, the index of the element is returned; if it is not found, a special value like '-1' is usually returned to indicate the element is absent.
Step-by-step explanation:
When searching for an element in an array, a) If the element is found, typically the index of the element is returned. b) If the element is not found, a special value is returned to indicate the absence of the element. This is often '-1' or some other value that is not a valid index. In programming, especially in languages like C++ or Java, returning the index allows the calling function to know the exact position where the element was found in the array.
If the element is not found, returning '-1' or a similar value is a common convention to indicate that the search was unsuccessful, as indices in arrays are always non-negative. When searching for an element in an array, the common practice is to return the index of the element if it is found. This allows the user to easily access the element in the array. If the element is not found, a common convention is to return a special value, such as -1, to indicate that the element is not present in the array.