Advertisement
Guest User

Untitled

a guest
Oct 27th, 2015
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. using System;
  2.  
  3. class AgeAfter10Years
  4. {
  5. static void Main()
  6. {
  7. Console.Write("Enter your birthdate (yyyy, mm, dd): ");
  8. DateTime birthDate = DateTime.Parse(Console.ReadLine());
  9.  
  10. int age = (int)((DateTime.Now - birthDate).TotalDays / 365.242199);
  11.  
  12. Console.WriteLine("Your age is: " + age);
  13. Console.WriteLine("Your age after 10 years will be: " + (age + 10));
  14. }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement