Assignment #3
Assignment #3
Write a function called odd_sum() that takes an integer array and its size as input and returns the
sum of all the odd numbers in the array. The function should return 0 if there is no odd number
in the input array. Function prototypes is given below:
Write C functions find_max() and find_min() that take in integer arrays and their sizes as inputs
and return the maximum/minimum number from that array. Function prototype for the two
functions are given below:
Write a function string_length() that calculates the length of the input character array.
The array will be NULL terminated. i.e. the last element of the array will be '\0'. This null
character will not be included in the array length. The function should return the length as an
integer value. Use of built-in functions for finding string length is NOT allowed. The function has
the following prototype:
Write a function count_num_times() that searches for a given number in the input array.
The function should return the number of times the searched number appears in the array. The
prototype for the function is given below:
Write a function mat_multiply() that takes in two integer arrays as input and computes the
dot product of these two matrices. We assume that none of the two matrices will be a scalar (1
x 1 matrix).
The function should return 1 if the matrix multiplication is possible, 0 otherwise. The result of the
multiplication are to be placed in the already declared matrix ‘result’.
The function takes the two arrays as input as well as the dimensions of the two input matrices in
the order [rows1, cols1, rows2, cols2]. The prototype of the function is given below:
int mat_multiply(int rows1, int cols1, int rows2, int cols2, ...
...int mat1[][cols1], int mat2[][cols2], int * no_concern);
Domain knowledge:
https://www.mathsisfun.com/algebra/matrix-multiplying.html
https://www.geeksforgeeks.org/pass-2d-array-parameter-c/