+ 1
What i want to do if i havd to generate random number between 20-100?
3 ответов
+ 16
Umm something like...
#include <iostream>
#include<cstdlib>
#include<ctime>
using namespace std;
int main() {
int x;
srand(time(0));
x=(1+(rand()%100));
if(x<20)
x=x+20;
cout<<x;
return 0;
}
+ 4
v = rand() % 100 + 20;