0
Why is output 12 time repeat SoloLearn??
int i=2048; while(i){ printf("SoloLearn\n"); i>>=1; }
2 Réponses
0
Because look, a while with no condition but just a number will keep running as long as the number is not 0. Each loop you divide i by 2. In the 12th loop, i becomes less than 1 (a decimal) and as i is an integer it truncates the decimal and becomes zero. So loop stops