using System.Diagnostics;
public static int InputInt(string prompt)
Console.Write("Enter " + prompt + ": ");
return Convert.ToInt32(Console.ReadLine());
public static void Main(string[] args)
while (ten_power_d * 10 <= n)
ten_power_d = 10 * ten_power_d;
Console.WriteLine("Number {0} has {1} decimal digits", n, d+1);