I have a number like this: int num = 36729; and I want to get the number of digits that compose the number (in this case 5 digits).
int num = 36729;
How can I do this?>
int findcount(int num) { int count = 0; if(num != 0){ while(num) { num /= 10; count ++; } return count ; } else return 1; }