As the other answers said, this is because it is unsigned and thatβs it. I will tell you about an elegant way to do what you want to do with an unsigned integer.
unsigned int i=10; while(i --> 0) printf("Hello:%u\n", i+1);
This --> sometimes referred to as going to . But actually itβs simple -- and > . If you change the interval, you will get
while( i-- > 0 )
My2c
source share