I have to find the square of a number / 12345 / - it's done. I wanted to make the program a bit more complicated and I have this:
using System;
class Program
{
static void Main()
{
Console.WriteLine("The square of the number 12345 is");
Console.WriteLine(Math.Sqrt(12345));
Console.WriteLine("Enter a number to calculate the square:");
int numVal = int.Parse(Console.ReadLine());
Console.WriteLine("The square of your number is" + " " + Math.Sqrt(numVal));
Console.WriteLine("Do you wish to enter another number? Yes / No");
string input = Console.ReadLine();
if (input == "Yes")
{
Console.WriteLine("Enter a number to calculate the square:");
int newNum = int.Parse(Console.ReadLine());
Console.WriteLine("The square of your number is" + " " + Math.Sqrt(newNum));
}
else
{
Console.WriteLine("Have a nice day!");
}
}
}
Now a have this problem: when the program asks if I want to enter another number, the answer should be with capital letter / Yes, No /. Is there a way to make it work even if I enter the answear with lower case / yes, no /?