Arrays - Largest & Smallest Number

We’re trying to find out max and min element in an array using a for loop for traversal and comparing every element with current max and min variable values, which we initialized as: int largest = INT_MIN; int smallest = INT_MAX;
using header file.
MY QUESTION is: If we simply initialize them as
int largest = arr[0];
int smallest = arr[0];
would that be ok? Or would we miss some corner cases if we do it this way?
Thanks!

Yes, This is Okay
because smallest and largest element will be definitely from array .

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.