+ 1
Whats the reason for usind rand()%15??
2 Answers
+ 5
it generates random number between 0 and 14... if you need random number you will use rand
0
(rand()%15) just means it will generate a random number larger then 0 and less then 15.
In C++ you can assign the rand() function to variables and call them later in your code... eg.
int var;
var=(rand()%14);
cout<<var;