एक फंक्शन लिखिए, जो किसी संख्याओं की सूची में से सबसे बड़े तत्त्व को लौटाता हो।
Answers
Answered by
0
Answer:
int largest(int arr[], int n)
{
int i;
// Initialize maximum element
int max = arr[0];
// Traverse array elements
// from second and compare
// every element with current max
for (i = 1; i < n; i++)
if (arr[i] > max)
max = arr[i];
return max;
}
// Driver Code
int main()
{
int arr[] = {10, 324, 45, 90, 9808};
int n = sizeof(arr) / sizeof(arr[0]);
cout << "Largest in given array is "
<< largest(arr, n);
return 0;
}
this will be the output .....plz run in python ...
Largest in given array is 9808
Explanation:
HOPE THIS HELPS U MY FRD !
PLZ MARK AS BRAINLIEST !
>>>>>>>THANK U<<<<<
#keep smiling :)
Similar questions
Science,
5 months ago
Chemistry,
5 months ago
Computer Science,
11 months ago
Computer Science,
11 months ago
History,
1 year ago
Hindi,
1 year ago
Math,
1 year ago