The below code runs perfectly.Gives the correct output but, the moment I change the sign of the variables from signed to unsigned the program runs into an infinite loop. The
The problem is that,
for(i=count-1;i>=0;--i)
Will never exit if i is unsigned. Because i is unsigned it will always be greater than or equal to zero, and thus the loop can't end.
i