[C] count_numerals.c

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
#include <stdio.h>
#include <math.h>
int main() {
int number, res = 0;
scanf("%d", &number);
res = floor(log10(number)) + 1;
printf("Result: %d", res);
return 0;
}