Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class HowOldYouWillBeAfter10Years
- {
- static void Main()
- {
- Console.WriteLine("How old are you?");
- int currentAge = int.Parse(Console.ReadLine());
- if (currentAge > 0 && currentAge <120)
- {
- Console.WriteLine("Your age now is " + currentAge + " years old but after 10 years you will be " + (currentAge + 10));
- if (currentAge + 10 > 120)
- {
- Console.WriteLine("Greetings! You are a Highlander!");
- }
- }
- else
- {
- Console.WriteLine("Please enter your age correctly!");
- Main();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment