Skip to content
C

Age Calculator

Easypython

Given a birth year and the current year, calculate and print the person's age in years.

What the problem means: rather than relying on today's actual date (which would make the expected answer change depending on when this is run), both the birth year and the "current" year are given as input, so the calculation is fully reproducible.

Approach: subtract the birth year from the given current year.

Input: Two lines: the birth year, then the current year.

Output: One line: Age: <age>

Input (stdin)

Output

Run your code to see output here...