Question: I am trying to learn how to write recursive functions in C and I wrote this function that counts the number of zeros in a specified positive number, as a practice. But, it can only handle input with a maximum length of 10. Input with 11 or more numbers fails and I can't see why.

Ex. 

```
input = 1204067809 (correct)
output = 3

input = 12040678091 (fails!!)
output = 0

input = 12040678091423401231 (fails!!)
output = 1

```

Code:

```
#include <stdio.h>
int rCountZeros1(int num); 

int main()
{
  int number;
  printf("Enter the number: \n");
  scanf("%d", &number);
  printf("rCountZeros(): %d\n", rCountZeros(number));
  return 0;
}

int rCountZeros(int num) 
{  
  if (num==0)
    return 1;
  else if (num<10)
    return 0;

  if (num % 10 == 0)
    return 1+rCountZeros(num/10);
  else
    return rCountZeros(num/10);
}

```

Answer: 
Each type of value in every programming language has a limit. In your case a 32-bit integer variable can handle a max value of 2,147,483,647. Anything more than that will cause an error.
I assume your compiler declares, `int` as 4 byte variable.
Your number should be between the range:

```
signed  : -2,147,483,648 to 2,147,483,647
unsigned: 0 to 4,294,967,295

```

If you want to perform the operation try using a `long long` integer.