Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Age After 10 Years #1

Open
ZlotoFtw opened this issue Sep 13, 2014 · 0 comments
Open

Age After 10 Years #1

ZlotoFtw opened this issue Sep 13, 2014 · 0 comments

Comments

@ZlotoFtw
Copy link
Owner

using System;

namespace AgeAfterTenYears
{
class AgeAfterTenYears
{
static void Main()
{
Console.WriteLine("Type Your Born Date (Example: 1995):");
string line = Console.ReadLine(); // Read string from console
int value;
if (int.TryParse(line, out value)) // Try to parse the string as an integer
{

            Console.WriteLine("Your Age: " + (2014 - value)); // Multiply the integer and display it
            Console.Write("Your Age After Ten Years: ");
            Console.WriteLine(2014 - value + 10); // Multiply the integer and display it
        }
        else
        {
            Console.WriteLine("Not an integer!");
        }
    }
}

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant