#include #include #include #include using namespace std; int main() { // remove comment on next line to see different numbers each run //srand(time(0)); cout << "The value of RAND_MAX is -- " << RAND_MAX << endl; cout << "Here are 10 random numbers between 0 and 19 : " << endl; for (int i = 0; i < 10; i++) cout << rand()%20 << ' '; cout << endl; cout << "Here are 10 random numbers between 1 and 20 : " << endl; for (int i = 0; i < 10; i++) cout << rand()%20 + 1 << ' '; cout << endl; cout << "Here are 10 random numbers between 15 and 28 : " << endl; for (int i = 0; i < 10; i++) cout << rand()%(28-15+1) + 15 << ' '; cout << endl; cout << "Here are 10 random numbers between 0 and 1 : " << endl; for (int i = 0; i < 10; i++) cout << static_cast(rand())/RAND_MAX << ' '; cout << endl; string str; cout << "Enter an integer -- "; cin >> str; cout << str << " + 17 = " << atoi(str.c_str()) + 17 << endl; int i; cout << "Enter an integer -- "; cin >> i; cout << i << " is "; if (abs(i) == i) cout << "positive"; else cout << "negative"; cout << endl; return 0; }