What has Possibly gone Wrong?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

What has Possibly gone Wrong??

Please see my code - What is Incorrect?? How?? Why??? for relevant details... Please Help... Edit: I tried the solutions given to me by @Krishna Teja Yeluripati and @Luka , but , alas, they still didn't work in my code... I am unable to understand the problem now as the range was 25-30 But the result was - 28:24:29:1: Please Help!

28th Mar 2017, 9:58 AM
Kinshuk Vasisht
Kinshuk Vasisht - avatar
2 Answers
+ 10
Don't do upper-- as it's not needed. This works. for (int i = 1; i <= 4; i++) { no = low + (rand() % (upper - low)); cout << no << ":"; }
28th Mar 2017, 10:30 AM
Krishna Teja Yeluripati
Krishna Teja Yeluripati - avatar
+ 5
Thank You, Sir
28th Mar 2017, 2:12 PM
Kinshuk Vasisht
Kinshuk Vasisht - avatar