Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class MyAgeAfterTenYears
- {
- static void Main()
- {
- DateTime currentDate = DateTime.Now;
- Console.Write( "Print your burthday: ");
- DateTime birthday = DateTime.Parse(Console.ReadLine());
- System.TimeSpan ageNow = currentDate - birthday;
- double yourAge = ageNow.TotalDays / 365.25;
- Console.WriteLine("Your age now is: " + ((int)yourAge));
- Console.WriteLine("Your age after 10 years will be: " + ((int)yourAge + 10));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment