Answer:
#include <stdlib.h>
#include <time.h>
#include <iostream>
using namespace std;
int main() {
srand(time(NULL));
cout << rand() % 30 << endl;
cout << rand() % 30 + 30 << endl;
cout << rand() % 30 + 60 << endl;
}
Step-by-step explanation:
rand() returns a pseudo-random integral number in the range between 0 and RAND_MAX. By applying the modulo operator, you map that to the desired range (30 in your case), then you add an offset.