What Is The Output Of The Following Codep Pre Langc #1775
What is the output of the following code?</p> <pre><code class="language-c"> #include<stdio.h> int get_max_element(int *arr,int n) { int i, max_element = arr[0]; for(i = 1; i < n; i++) if(arr[i] > max_element) max_element = arr[i]; return max_element; } int get_min_element(int *arr, int n) { int i, min_element; for(i = 1; i < n; i++) if(arr[i] < min_element) min_element = arr[i]; return min_element; } int main() { int n = 7, arr[7] = {1,1,1,0,-1,-1,-1}; int max_element = get_max_element(arr,n); int min_element = get_min_element(arr,n); printf("%d %d",max_element,min_element); 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 - 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
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