Run ❯
Get your
own
website
×
Change Orientation
Change Theme, Dark/Light
Go to Spaces
#include
#include
using namespace std; int main() { double x = 1260.0; int digits = floor( log10( x ) ) + 1; cout << "The number " << x << " has " << digits << " digits."; return 0; }
The number 1260 has 4 digits.