While loop in broken calculator

hi, according to the editorial this piece of code is given:-
while (carry)
{
res[res_size] = carry%10;
carry = carry/10;
res_size++;
}

so, i want to ask if carry is 0 initially then, this loop’s body will never execute so how we, will increase the res_size.

hello @prashantrsj25

if carry is 0 then we are not required increase res size and here also same thing happening.
for carry 0 , while loop will not run and res size will not increment