Question:
(a) What is a function? Are functions needed when writing a C program?
(b) State one of the advantages to the use of functions.
(c) What do you meant by understand by a function call? From what parts of a program can a function be called?
(d) Each of the following is the first line of a function definition. Explain the meaning of each.
i) float func1(float a, float b)
ii) long fz(int z)
iii) void f(double abc)
iv) char f(void)
(e) Write the first line of the function definition, including the formal argument declarations, for each of the situations described below.
i) A function called RandomInt that generates and returns an integer value.
ii) A function called SquareRoot that accepts two floating point values as arguments and returns a floating-point result.
iii) A function called ConvertChar accepts a character and returns another character.
(f) Write a function that takes two integer values and return the sum of these two values.