C priting number 2^31-1 or -2^31+1 : I have to submit this code , the intention is to count the digits of a number and print it(range can be 2^31-1 or -2^31+1) and the result ust be present as a single number (ex number 234 is printed 3)

 

      #include <stdio.h>
      #include <stdlib.h>
      int main()
      {
        long int num_ins;
        int contador = 0;
        printf("Inserir numero desejado a avaliar?\n"); // asking the number
        scanf("%lu", &num_ins);
        if (num_ins == 0){
            printf("%d", 1);
        }
        else{
            while(num_ins!=0){
                num_ins = num_ins/10;
                contador++;
        }
        printf("%d", contador); //contador is count
        }
        }

But the submission keep giving me an error, that there are some number who isn't right, and i can't figure it
