Consider the following piece of code:
int function(int a[], int n, int x)
{
int i;
for (i=0; i<n && a[i]!=x;i++);
if (i==n) return -1;
else return i;
}
A function call is made with the arguments as follows:
- $a[]=\{5, 32, 1, 9, 7, 2\}$
- $n=6$
- $x=8$
What will be the value returned by the above code?