Question: Write a program to generate a random number with a value between the last 2 digits of your year of birth and age in years.

Write a program to generate a random number with a value
between the last 2 digits of your year of birth and age in
years.
The program should ask the user to enter these 2 values &
validate them as well.
The program should accept any birth year and age
combination, it does not have to validate that the age is
correct for the year
For example; if you are born in the year 2001, then you are 19
years old; generate a random number between 1&19.
NOTE Validate means check that the numbers are >0(not
negative) and assume they entered a number, therefore don't
need isdigit() but you can use isdigit() if you want
Write a program to generate a random number with

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!