This asks the user to input 10 different digits. then prints out the highest and lowest values. else if (n < lowest) this could also be a else if because if n is the highest value it cant be also the lowest value because of my initialization at the start. share|improve this answer edited Sep 17 '13 at 0:08