+ 2
How can and do I use a randnom int if possible?
3 Réponses
+ 1
thanks
+ 1
#include <iostream>
#include <ctime>
int main()
{
srand(time(0));
std::cout<<(rand()%10+1)<<std::endl;
return 0;
}
the above will output a random number 1-10 each time it is run with the seed being the current time
0
Int x=rand();