main(.)
)
deal with user input and output. Ask the user to
enter the number of parallel resistors of the circuit
and then ask for the resistance of each resistor using a
for
loop.
size_t count_matches(int array[], size_t dimension, int number)
that returns how many times the given number occurs in the array.
For example
int array[] = {4, 1, 7, 5, 4, 1, 4, 2, 7};
count_matches(array, 9, 5); // returns 1
count_matches(array, 9, 4); // returns 3
Name the source file: count_matches.c
int max(int array[], int dimension)
that takes
an array of integers and its dimension and returns the array's highest
number. Try to determine a way to figure out the
number of elements in the array inside the function max(.)
.
You may
assume that the passed array is never empty.
int array[] = {4, 1, 7, 5, 4, 1, 4, 2, 7};
max(array, 9); // returns 7
Name the source file: find_max.c