Int largest=INT_MIN; int smallest=INT_MAX;

why largest is initialize with INT_MIN OR smallest with INT_MAX in your code that you explain

@shivansh2633_325a8cde6e2dea44
we want to initialise with value that can be easily replaced by value in array.
so for max we intialise it with int_min so that any number in array will be greater that int_min ands hence it will easily replaced.
same logic for min

i hope this help
if you have further doubt
feel free to ask

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.