Write statements that assign random integers to the variable n in the following ranges:

```
a) 1 n 2
b) 1 n 100
c) 0 n 9
d) 1000 n 1112
e) –1 n 1
f) –3 n 11
```

```
a) n = 1 + rand() % 2;
b) n = 1 + rand() % 100;
c) n = rand() % 10;
d) n = 1000 + rand() % 113;
e) n = rand() % 3 - 1;
f) n = rand() % 15 - 3;
```

Computer Science & Information Technology

You might also like to view...

To ensure the ________ of the database, access to several features must be eliminated

A) integrity B) usability C) functionality D) security

Computer Science & Information Technology

Identify the letter of the choice that best matches the phrase or definition.

A. The difference between actual dates and baseline data B. A record of the scheduled dates and costs for each task of a project at a particular time C. A set of start and finish dates you save periodically as your project progresses D. Subset of resources that exchanges status information about parts of a project through a network E. On a Gantt Chart task bar, indicates how much of the task has been completed F. Amount of time a task can be delayed without the delay affecting the entire project G. Amount of time a task can be delayed without affecting any successor tasks H. The difference between a task's scheduled start and baseline start date or its finish date and baseline finish date I. How you determine whether a project is staying close to budget or not J. Category of costs that is the calculated cost of a project, task, resource, or assignment for the duration of the project K. Category of costs that is the task, resource, or assignment costs distributed over time L. View that is saved with a name and differs from the default views

Computer Science & Information Technology