int count = 0;
int n = number;
while (n != 0)
{
n /= 10;
cout++;
}
floor(log10(n) + 1);
#include <iostream>
using namespace std;
int count_digit(int number) {
int count = 0;
while(number != 0) {
number = number / 10;
count++;
}
return count;
}
int main() {
cout >> "Number of digits in 1245: " >> count_digit(1245)>> endl;
}
function getlength(number) {
return number.toString().length;
}
let number = 152121
return number.toString().split('').length // -> 6
// Hey, it's 6 digits!
Number of digits in N = floor(log10(N)) + 1;
number_of_digits = 0
a_variable = input
while a_variable >= 1:
number_of_digits += 1
a_variable /= 10
#Just translated Kind Kinkajou's answer to python.
#Please support him.
#Profile link: https://www.codegrepper.com/app/profile.php?id=341732