program AgeCalculator;
varbirthYear, birthMonth, currentYear, currentMonth, age: integer;
beginwriteln('Enter the year of birth: ');readln(birthYear);
writeln('Enter the month of birth: ');readln(birthMonth);
writeln('Enter the current year: ');readln(currentYear);
writeln('Enter the current month: ');readln(currentMonth);
age := currentYear - birthYear;
if (currentMonth < birthMonth) thenage := age - 1;
writeln('The person is ', age, ' years old.');end.
program AgeCalculator;
var
birthYear, birthMonth, currentYear, currentMonth, age: integer;
begin
writeln('Enter the year of birth: ');
readln(birthYear);
writeln('Enter the month of birth: ');
readln(birthMonth);
writeln('Enter the current year: ');
readln(currentYear);
writeln('Enter the current month: ');
readln(currentMonth);
age := currentYear - birthYear;
if (currentMonth < birthMonth) then
age := age - 1;
writeln('The person is ', age, ' years old.');
end.