.Equals
if correct.Equals("yes", StringComparison.InvariantCultureIgnoreCase) { Console.WriteLine("Great :D"); Console.ReadLine(); return; } if correct.Equals("no", StringComparison.InvariantCultureIgnoreCase) { Console.Write("Do you want to try again?"); string fail = Console.ReadLine(); if correct.Equals("yes", StringComparison.InvariantCultureIgnoreCase) { continue; } if (fail == "NO") { Console.WriteLine("why would u do that bro"); Console.ReadLine(); return;
namespace console{ internal class Program { public static void Main(string[] args) { while (true) { Console.Write("Enter your name:"); string name = Console.ReadLine(); Console.Write("Enter your age:"); string age = Console.ReadLine(); Console.Write("Hello " + name + " you are " + age + ". is this correct:"); string correct = Console.ReadLine(); if (correct == "YES") { Console.WriteLine("Great :D"); Console.ReadLine(); return; } if (correct == "NO") { Console.Write("Do you want to try again?"); string fail = Console.ReadLine(); if (fail == "YES") { continue; } if (fail == "NO") { Console.WriteLine("why would u do that bro"); Console.ReadLine(); return; } } } } }}