What Is The Output Of The Following Codep Pre Langc #1612
What is the output of the following code?</p> <pre><code class="language-c"> 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; }</code></pre>
This multiple choice question (MCQ) is related to the book/course gs gs122 Data Communication and Computer Network. It can also be found in gs gs122 Recursion - Recursion - Quiz No.2.
Similar question(s) are as followings:
Online Quizzes of gs122 Data Communication and Computer Network
Sorting - Insertion Sort - Quiz No.1
gs gs122 Data Communication and Computer Network
Online Quizzes
Sorting - Insertion Sort - Quiz No.2
gs gs122 Data Communication and Computer Network
Online Quizzes
Sorting - Insertion Sort - Quiz No.3
gs gs122 Data Communication and Computer Network
Online Quizzes
Sorting - LSD Radix Sort - Quiz No.1
gs gs122 Data Communication and Computer Network
Online Quizzes
Sorting - MSD Radix Sort - Quiz No.1
gs gs122 Data Communication and Computer Network
Online Quizzes
Sorting - MSD Radix Sort - Quiz No.2
gs gs122 Data Communication and Computer Network
Online Quizzes