0

Hi, I did some C++ assignments and was confused about a certain code.

```
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
long result, input, num, count;
count = 0;
cout << "key in number";
cin >> input;
while (input>0)
{ count++;
input /=10;
}
cout << count;
cout << "\n";
system("pause");
return 0;
}
```

For this code, I'm trying to find how many digits for the number at input.

However, I can't get the answer for 9999999999 (10 digits) but it works fine for 9 digits and below.

I know it's easy to explain but I can't figure it out. Sorry about that =\