#include <iostream>
#include <string>
#include <stdbool.h>
using namespace std;
int largestNumber(int arr[], int n){
// setting the first item maximum
int max = arr[0];
for(int i = 1; i < n; i++){
if(arr[i] > max)
max = arr[i];
}
return max;
}
int main(){
int arr[] = {10, 20, 22, 11, 5};
int n = sizeof(arr) / sizeof(arr[0]);
cout << "Largest in array given: " << largestNumber(arr, n) << endl;
return 0;
}