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...

Do applications need to exchange UDP control messages before exchanging data? Explain.

What will be an ideal response?

Computer Science & Information Technology

Syntax of C++ can be described as

A. use of object-oriented programming techniques. B. grammatical rules. C. level of complexity. D. use of keywords.

Computer Science & Information Technology

Storage consists of electronic components that store instructions and data waiting to be executed.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

The IEEE separated the OSI model Physical layer into the LLC sublayer and the MAC sublayer.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology