Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int yrBorn;
- int year = DateTime.Now.Year;
- while (true)
- {
- Console.WriteLine("How old are you?");
- int age = int.Parse(Console.ReadLine());
- Console.WriteLine("Did you already have a birthday?");
- string answer =Console.ReadLine();
- yrBorn = (year - age);
- if (answer == "Y" || answer == "YES")
- {
- Console.WriteLine("You were born in " + yrBorn);
- }
- else
- {
- Console.WriteLine("You were born in " + (yrBorn-1));
- }
- Console.WriteLine("Would you like to try another person?");
- string answer2 = Console.ReadLine();
- if (answer2 != "Y" && answer2 != "YES")
- {
- break;
- }
- }
- Console.ReadKey(true);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement