C#:
using System;
namespace ConsoleUI
{
class Program
{
static void Main()
{
Console.WriteLine("Please enter the year you were born");
string yearBorn = Console.ReadLine();
int age = 0;
int millenium = 2000;
bool isValid = int.TryParse(yearBorn, out age);
if (isValid == true)
{
millenium -= age;
Console.WriteLine($"You were {millenium} years old in the year 2000");
}
else
{
Console.WriteLine($" you were not born");
}
Console.ReadLine();
}
}
}
Hi all
I am trying to display to the user when they enter the year they were born how old they were in the year 2000, However, when the user types a year after 2000, I want it to show that they were not born yet