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.
Login
Login
OnlineGDB Q&A
Questions
Unanswered
Tags
Ask a Question
Ask a Question
How Can I make a Random Number with set limits??
+1
vote
asked
May 12, 2020
by
popstar403
(
750
points)
Please
log in
or register to answer this question.
1 Answer
0
votes
answered
May 13, 2020
by
LiOS
(
6,460
points)
Yep. Terms are the upper limit, lower limit and the gap between numbers e.g. +1 = 1,2,3,4 while +2 = 2,4,6,8
In C:
(rand() % (upper - lower + 1)) + lower;
In Python:
randrange(start, stop, step)
Please
log in
or register to add a comment.
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and receive answers from other members of the community.
...