find the digits of a number in c

find the digits of a number in c

How do I see how many digits the numbers have?

refer to‮l:‬autturi.com
/*
Get the number of digits in integer using C
*/

#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <assert.h>

int main() {
	int number = 12345;
    int numberOfDigits = 1 + log10(number);
    printf("number: %d digits: %d",number,numberOfDigits);
    return 0;
}
Created Time:2017-08-29 12:54:00  Author:lautturi