For example we have list of integers:
18, 13, 23, 12, 27
Initially large = 18;
In first comparison small > 13; true , Now small becomes 13.
In second comparison small > 23; false , Now small is 13.
In third comparison small > 12; true , Now small becomes 12.
In forth comparison small > 27; false , Now small is 12.
Consider the example:
Output