Write a single statement that prints a number at random from each of the following sets:

a) 2, 4, 6, 8, 10.
b) 3, 5, 7, 9, 11.
c) 6, 10, 14, 18, 22.

a) ```
cout << 2 * ( 1 + rand() % 5 ) ) << ’\n’;
```
b) ```
cout << 1 + 2 * ( 1 + rand() % 5 ) ) << ’\n’;
```
c) ```
cout << 6 + 4 * ( rand() % 5 ) << ’\n’;
```

Computer Science & Information Technology

You might also like to view...

When using Task Manager, the Processes tab is used to see how Apps, Background processes, and Windows processes are using the system resources

Indicate whether the statement is true or false

Computer Science & Information Technology

The ____________ fstream member function opens a file stream and connects the stream variable to a physical file whose name is the argument to the function.

a) close( ) b) overloaded operator <<( ) c) open( ) d) eof( ) e) flush( )

Computer Science & Information Technology