public static void main(string[] args)
output("Enter a number between 51 and 100:" + "\n");
while (n < 51 || n > 100)
output("Error: The number is not between 51 and 100." + "\n");
output("Enter a number between 51 and 100:" + "\n");
output("Congratulations!" + "\n");
' .NET can only read single characters or entire lines from the console.
' The following functions are designed to help input specific data types.
private static double inputValue()
while (!double.TryParse(Console.ReadLine(), out result));
private static string inputText()
return Console.ReadLine()
private static output(string text)