Ad
Numbers
Data Types
Integers
Algorithms
Logic
Code
Diff
  • #include <math.h>
    #include <stdint.h>
    
    uint8_t number_of_digits(uint64_t n)
    {
        return log10(n) + 1;
    }
    • #include <stdlib.h>
    • #include <math.h>
    • #include <stdint.h>
    • uint_fast8_t number_of_digits(uint64_t n)
    • uint8_t number_of_digits(uint64_t n)
    • {
    • size_t x;
    • printf("%lu%n", n, &x);
    • return x;
    • return log10(n) + 1;
    • }