my question is quick and simple. how do i generate random numbers but between 1 and 52?
i know how to generate numer between 0 and 52 but no idea how to do it if it starting with 1. thanks a lot :)
//randomize random number generator using current time
cout<<"Generate random numbers between 1-52"<<'\n'<<endl;
//type your favorite pause statement HERE e.j "cin.ignore();" or whatever you want
return 0; //indicate successful termination
* from C++ How to program,5th edition book:
* randomNumber=shiftingValue + rand() % scalingFactor;
* where shiftingValue is equal to the first number in the desired range of consecutive integers and scalingFactor is equal to the width of the desired range of consecutive int egers. The exercises show that it is possible to choose integers at random from sets of values other than ranges of consecutive integers.