Guest User

AgeInTheFuture

a guest
Mar 8th, 2014
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.42 KB | None | 0 0
  1. using System;
  2.  
  3. class AgeInTheFuture
  4. {
  5.     static void Main()
  6.     {
  7.         Console.Write("Enter date of birth mm/dd/yyyy:");
  8.         DateTime birthDay = DateTime.Parse(Console.ReadLine());
  9.         TimeSpan difference = DateTime.Now.Subtract(birthDay);
  10.         Console.WriteLine("Now you are {0} years old.",difference.Days/365);
  11.         Console.WriteLine("In 10 years you will be {0}!",(difference.Days/365)+10);
  12.     }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment