cantidad de digitos

C++
cantidad_digitos = 0;
	while(n > 0){
		cantidad_digitos++;
		n = n / 10;
	}
Source

Also in C++: