As while finding the smallest or largest number separately, we assign the largest or smallest variable the value of A[0]. Similarly, in this program - can’t we assign both smallest and longest the values of A[0] like -
int longest=A[0];
int smallest=A[0];
instead of assigning them the INT_MIN & INT_MAX values?.
Since both are producing the same results!
Can't We assign A[0] to smallest and largest?
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.