You did not specified the language, so I did my program in python.
Hope it helps!!!
Answer:
- import datetime
-
- def get_year_of_birth():
- age = int(input("Enter your age: "))
- current_year = datetime.datetime.now().year
- year_of_birth = current_year - age
- return year_of_birth
-
- print(get_year_of_birth())
Explanation:
Firstly, we import datetime module as we need it to get the current year (Line 1).
Next, create a function named it as get_year_of_birth (Line 3). Prompt user to input age and assign it to a variable (Line 4). Next, we use now() method from datetime module to get the current date and time and extract the year component (Line 5). At last, calculate the year of birth by subtracting the current_year with age and return it as output (Line 6-7).
True because if you were to bold a text, you have presented that the following text is more important or exemplified.
Answer:
What is the question here? lol
Explanation: