Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _09.AgeAfterTenYears
- {
- class AgeAfterTenYears
- {
- static void Main(string[] args)
- {
- Console.Write("Enter Your Birthday with dd.mm.yyyy format: ");
- DateTime birthDay = DateTime.Parse(Console.ReadLine());
- DateTime today = DateTime.Now;
- int currentAge = today.Year - birthDay.Year;
- if (today.Month <= birthDay.Month && today.Day <= birthDay.Month)
- {
- currentAge--;
- }
- Console.WriteLine("You are currently {0} years old. You will be {1} years old after 10 years.", currentAge, currentAge + 10);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement