What Is The Output Of The Following Codep Pre Langc #1781

What is the output of the following code?</p> <pre><code class="language-c"> #include<stdio.h> int max_of_two(int a, int b) { if(a > b) return a; return b; } int min_of_two(int a, int b) { if(a < b) return a; return b; } int recursive_max_element(int *arr, int len, int idx) { if(idx == len - 1) return arr[idx]; return max_of_two(arr[idx], recursive_max_element(arr, len, idx + 1)); } int recursive_min_element(int *arr, int len, int idx) { if(idx == len - 1) return arr[idx]; return min_of_two(arr[idx], recursive_min_element(arr, len, idx + 1)); } int main() { int n = 5, idx = 0, arr[] = {1,1,1,1,1}; int max_element = recursive_max_element(arr,n,idx); int min_element = recursive_min_element(arr,n,idx); printf("%d %d",max_element,min_element); return 0; }</code></pre>

Online Quiz 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 - Largest and Smallest Number in an Array using Recursion - Quiz No.1.


Similar question(s) are as followings:



Online Quizzes of gs122 Data Communication and Computer Network

Choose an organization

Theme Customizer

Gaussian Texture



Gradient Background