Assume the following environment

```
#define MAX 50
int a[MAX], i, j, temp;
```
What is the effect of the following program segment?
```
temp = 0;
for (i = 1; i < MAX; ++i)
if (a[i] > a[0])
++temp;
```
a. Arranges the elements of array a in ascending order.
b. Counts the number of elements of array a greater than its initial element.
c. Reverses the numbers stored in the array.
d. Puts the largest value in the last array position.
e. None of the above.


b. Counts the number of elements of array a greater than its initial element.

Computer Science & Information Technology

You might also like to view...

A linked list class keeps its elements in the order in which they are added, with the index of an element X being greater than the index of any element added to the list before X. Addition of new elements to such a list can be made more efficient

A) by keeping a reference to the element with the least index B) by starting at the head, and quickly traversing the list to locate the place where a new element should be added C) by keeping a reference to the last element added D) None of the above

Computer Science & Information Technology

Each table row contains all categories of data pertaining to one entity and is called a:

A) query. B) database. C) record. D) field.

Computer Science & Information Technology

Which of the following tasks has not been started according to the accompanying figure?

A. Build Request for Proposal B. Detail current status C. Test security D. Choose vendors

Computer Science & Information Technology

What two defining characteristics of Ethernet ensure communication and scalability when going from 100-megabit standards to 1000-megabit (and beyond)?

What will be an ideal response?

Computer Science & Information Technology