Home / MCQ Bank / Computer
Computer Miscellaneous On Data Structures

What is the output of the following code? void my_recursive_function(int *arr, int val, int idx, int len) { if(idx == len) { printf("-1"); return ; } if(arr[idx] == val) { printf("%d",idx); return; } my_recursive_function(arr,val,idx+1,len); } int main() { int array[10] = {7, 6, 4, 3, 2, 1, 9, 5, 0, 8}; int value = 2; int len = 10; my_recursive_function(array, value, 0, len); return 0; }

Select the best option to verify your answer:
Show Correct Answer
Correct Answer: Option B • 4

Related Computer Questions

How many properties are associated with the Response event? ______ forge software for the development of software projects. In NiFi, what is the primary function of the "UpdateRecord" processor? What data structure is typically used to implement a system for efficiently managing and updating a large set of numerical data? In data ethics and privacy, what is the primary goal of "data audit trails"?