Advertisement
Fricer

Age after 10 years

Jun 14th, 2014
822
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.43 KB | None | 0 0
  1. using System;
  2.  
  3. class AgeAfter10Years
  4. {
  5.     static void Main(string[] args)
  6.     {
  7.         Console.Write("Enter your birth date: ");
  8.         DateTime BirthDay = DateTime.Parse(Console.ReadLine());
  9.         int age = (int)((DateTime.Now - BirthDay).TotalDays / 365.242199);
  10.         Console.WriteLine("You are " + age + " year(s) old");
  11.         Console.WriteLine("After ten years you will be at the age of " + (age + 10));
  12.     }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement