This exercise is available at https://study.find-santa.eu/exercises/c/arrays/.
For the sake of the environment, please avoid printing these instructions in the future. Thank you!

C Arrays

  1. Total Resistance
    Develop a program that calculates the total resistance of n parallel resistors like in the schematic below.
    File:Resistors in parallel.svg
    The program should use a separate function for the actual calculation. The total resistance can be calculated with this formula: Rtotal=1i=1n1Ri
    Name the source file: parallel_resistors.c
  2. Count Matching Elements
    Write a function 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
  3. Find Maximum
    Write a function 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