0
Why is one is added for finding a random variable in a specific range like
for finding random variable within 8 we type cout code as cout>>1+rand()%8;
5 Answers
+ 1
Note, this shifts the entire range +1 (0..7 becomes 1..8)
0
in case the remainder is 0 and you don't want it to be 0
0
thanks
0
what diff do we get if it is shifted or not
0
Hemanth without the +1 the range is 0 to 7, with it it's 1 to 8