Programming Fundamentals
Download count_bigger.c here
Or, copy these file(s) to your CSE account using the following command:
1511 fetch-activity count_bigger
Your task is to add code to this function in count_bigger.c:
// return the number of "bigger" values in an array (i.e. larger than 99
// or smaller than -99).
int count_bigger(int length, int array[]) {
// PUT YOUR CODE HERE (you must change the next line!)
return 42;
}
count_bigger should return a single integer: the number of values in the
array which are larger than 99 or smaller than -99.
For example if the array contains these 8 elements:
141, 5, 92, 6, 535, -89, -752, -3
Your function should return 3, because these 3 elements are
bigger than 99 or smaller than -99:
141, 535, -752
Assumptions/Restrictions/Clarifications
count_biggershould return a single integercount_biggershould not change the array it is givencount_biggershould not callscanf(orgetcharorfgets)- You can assume the array contains at least one integer
count_biggershould not print anything. It should not callprintf- Your submitted file may contain a main function. It will not be tested or marked