#include <stdio.h>
#include <time.h>
#include <stdlib.h>

#define SIZE 10
#define MIN_VALUE 0
#define MAX_VALUE 100

int maxValueCalc(int arr[]);

int main(void) {
	srand(time(NULL));
	
	int arr[SIZE];
	
	for (int i = 0; i < SIZE; i++) {
		arr[i] = rand() % (MAX_VALUE - MIN_VALUE + 1) + MIN_VALUE;
		printf("%d ", arr[i]);
	}
	
	printf("\n\nMax value in the array: %d\n", maxValueCalc(arr));
	
	return 0;
}

int maxValueCalc(int arr[]) {
	int maxValue = arr[0];
	
	for (int i = 0; i < SIZE; i++) {
		if (arr[i] > maxValue) {
			maxValue = arr[i];
		}
	}
	
	return maxValue;
}