Consider the following piece of code:
int function(int a, int n, int x)
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:
What will be the value returned by the above code?
Please fix, the code segment is not properly showing up in the test.