Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class AgeAfter10Years
- {
- static void Main()
- {
- Console.Write("Enter your birthdate (yyyy, mm, dd): ");
- DateTime birthDate = DateTime.Parse(Console.ReadLine());
- int age = (int)((DateTime.Now - birthDate).TotalDays / 365.242199);
- Console.WriteLine("Your age is: " + age);
- Console.WriteLine("Your age after 10 years will be: " + (age + 10));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement