The loop will end


#1

as the while(i > 0)
so when the value of become i = 0; than it will not fulfill the condition i > 0 so the loop would end there

    int a = 0, i = 10;
    int count = 0;
    while (i > 0) {
        a += i;
        i /= 2;
        System.out.println(i);
        ++count;
    }
    System.out.println(count);

OUTPUT :-
5
2
1
0
4