SHARE
TWEET

Untitled

a guest Oct 27th, 2015 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top