- #1
- 1,041
- 3
I wrote a program to find the number of digits of an integer, but I always get the wrong result. Could someone point out the error? Here's the source code:
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int i=53443;
cout<<log(i);
return 0;
}
The log function gives me a weird result each time. I don't know why though. I am using dev c++ compiler...
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int i=53443;
cout<<log(i);
return 0;
}
The log function gives me a weird result each time. I don't know why though. I am using dev c++ compiler...