Home / MCQ Bank / Computer
Computer Miscellaneous On Data Structures Difficulty: Medium

What does the following code do? #include<stdio.h> int search_num(int *arr, int num, int len) { int i; for(i = 0; i < len; i++) if(arr[i] == num) return i; return -1; } int main() { int arr[5] ={1,2,3,4,5},num=3,len = 5; int indx = search_num(arr,num,len); printf("Index of %d is %d",num,indx); return 0; }

Select the correct option to test your answer:

More Computer Questions

. . . . . . . . domain name is an open extension available for general use. What will be the output of the following Python functions? x=3 eval('x^2') How many properties are associated with the Response event? Which of the following creates a pattern object? What is the purpose of the strip() method for strings?