//OPTION #1 int d = 1; double temp = n; while (temp > 0.0009) { temp = temp / 10; d++; }