Yup I did something similar a while ago in my C course.
Basically, you have a certain amount of numbers, and two variables, max and min for example.
let's say the first number is min and the last one is max, or whatever You basically make a loop, and compare the current max / min with all the numbers. If there is any number smaller or larger, then set the new max to that number.