Advertisement
FLISEN

MyAge

Dec 29th, 2012
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.49 KB | None | 0 0
  1. using System;
  2.  
  3.     class MyAge
  4.     {
  5.         static void Main()
  6.         {
  7.             Console.WriteLine("Enter your current age: ");
  8.             int CurrentAge = int.Parse(Console.ReadLine());
  9.             if (CurrentAge < 0 | CurrentAge > 120)
  10.             {
  11.                 Console.WriteLine("Your age is not correct!");
  12.             }
  13.             else
  14.             {
  15.                 Console.WriteLine("Your age after 10 years will be: " + (CurrentAge + 10));
  16.             }
  17.         }
  18.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement