Computer Science, asked by arnabtherockstar, 6 months ago

. java
write a program to input your birth year and calculate your age ​

Answers

Answered by jethybibhusit
1

Answer:

Input the current date and birth date of a person

Check for the conditions

If current month is less than the birth month, then we will not consider the current year because this year has not been completed yet and to compute the differences in months by adding 12 to the current month.

If the current date is less than the birth date, then we will not consider month and for generating subtracted dates add number of month days to the current date and the result will difference in the dates.

When this conditions are meet just subtract the days, months and year to get the final result

Print the final age

Similar questions