User Input
User Input
using System;
Console.ReadLine();Convert.ToInt32(Console.ReadLine())Exercise
using System;
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Enter your YOB:");
int yob = Convert.ToInt32(Console.ReadLine());
//Do not modify code below!
int age = 2022 - yob;
Console.WriteLine($"You are {age} years old!");
}
}Exercise
Last updated