VyaraG

MyAgeAfterTenYears

Nov 28th, 2014
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.55 KB | None | 0 0
  1. using System;
  2.  
  3.     class MyAgeAfterTenYears
  4.     {
  5.         static void Main()
  6.         {
  7.             DateTime currentDate = DateTime.Now;
  8.             Console.Write( "Print your burthday: ");
  9.             DateTime birthday = DateTime.Parse(Console.ReadLine());
  10.             System.TimeSpan ageNow = currentDate - birthday;
  11.             double yourAge = ageNow.TotalDays / 365.25;
  12.             Console.WriteLine("Your age now is: " + ((int)yourAge));
  13.             Console.WriteLine("Your age after 10 years will be: " + ((int)yourAge + 10));
  14.  
  15.  
  16.         }
  17.     }
Advertisement
Add Comment
Please, Sign In to add comment