Advertisement
Devilchild656

15.Problem

Mar 9th, 2014
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.67 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _15.Age
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             Console.WriteLine("Enter your BirthDay:");
  10.             Console.WriteLine("mm.dd.yyyy");
  11.             DateTime DateOfBirth;
  12.             DateOfBirth = DateTime.Parse(Console.ReadLine());
  13.             var now = float.Parse(DateTime.Now.ToString("yyyy.MMdd"));
  14.             var dob = float.Parse(DateOfBirth.ToString("yyyy.MMdd"));
  15.             var age = (int)(now - dob);
  16.             Console.WriteLine("You are now  = {0}", age);
  17.             Console.WriteLine("You will be after 10 year   = {0}", age + 10);
  18.            
  19.            
  20.         }
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement