I\'m trying to generate random number between 0 and 40(inclusive). So the code I Implemented is this-
y=rand()%41;
However everytime I click c
It is generated by an argument passed seed. To generate different numbers add this before calling the rand() function:
rand()
srand (time(NULL));
This generates a new random seed.
You should have this library: #include And if you still have an error use this one as well: #include
#include