121. Data Conversion and Encoding-i

Question.4

A developer's custom itoa function uses the modulo-divide loop:

void my_itoa(int num, char *str) {
   int i = 0;
   while (num > 0) {
       str[i++] = (num % 10) + '0';
       num /= 10;
   }
   str[i] = '\0';
   // reverse str here...
}

What does my_itoa(0, buf) produce?

Need Help? Refer to the Quick Guide below

Select Answer