Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

How to set rand range

+2 votes
asked Apr 26, 2020 by Lerj (160 points)

If you put 

rand() % 30 + 1985;
The range would be 1985-2014
even though i would think it would be 30-1985?

1 Answer

+1 vote
answered Apr 27, 2020 by chn (240 points)
It would be rand % (1985-30+1) + 30
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...