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

In general, a class’s data fields should be declared as ______.

a) public b) protected c) private d) package access

Computer Science & Information Technology

Which of the following is a correct declaration of enumerated type for the suits of a deck of cards?

a) enumerated type Suit = { hearts, spades, diamonds, clubs }; b) enum Suit {hearts, spades, diamonds, clubs }; c) enum Suit {hearts, spades, diamonds, clubs } d) enumerated type Suit = {hearts, spades, diamonds, clubs }; e) enum Suit = { hearts, spades, diamonds, clubs }

Computer Science & Information Technology