Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Program
- {
- static void Main()
- {
- Console.Write("Enter your birthday in format(dd.mm.yyyy): ");
- DateTime userBirthday = DateTime.Parse(Console.ReadLine());
- long result = DateTime.Today.Subtract(userBirthday).Ticks;
- Console.WriteLine("You are {0} years old.", new DateTime(result).Year - 1);
- Console.WriteLine("In 10 years you will be {0} years old.", new DateTime(result).AddYears(10).Year - 1);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement