1#include<iostream>
2
3using namespace std;
4
5public void getMax_MinValue(int arr[])
6{
7 int max, min;
8
9 max = arr[0];
10 min = arr[0];
11 for (int i = 0; i < sizeof(arr); i++)
12 {
13 if (max < arr[i])
14 max = arr[i];
15 else if (min > arr[i])
16 min = arr[i];
17 }
18
19 cout << "Largest element : " << max;
20 cout << "Smallest element : " << min;
21
22}