Advertisement
KodingKid

How to calculate how old someone is in C#

Apr 19th, 2021
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.15 KB | None | 0 0
  1. Console.WriteLine("Enter your birth-year:");
  2. int year = Convert.ToInt32(Console.ReadLine());
  3. int age = 2021 - age
  4. Console.WriteLine("Your age is: " + age);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement