Question
(C PROGRAMING PLEASE) 10. Give the function header(prototypes) for each of the following functions. a. Function hypotenuse that takes two double-precision floating-point arguments, side1 and
(C PROGRAMING PLEASE)
10. Give the function header(prototypes) for each of the following functions.
a. Function hypotenuse that takes two double-precision floating-point arguments, side1 and side2, and returns a double-precision floating-point result.
b. Function smallest that takes three integers, x, y, z, and returns an integer.
c. Function instructions that does not receive any arguments and does not return a value. [Note: Such functions are commonly used to display instructions to a user.]
d. Function intToFloat that takes an integer argument, number, and returns a floating- point result.
11. Find the error in each of the following program segments and correct the error.
a. #define SIZE 100;
b. int b[10] = { 0 }, i;
for (i = 0; i <= 10; ++i) {
b[i] = 1;
c. #define VALUE = 120;
d. int a[2][2] = { { 1, 2 }, { 3, 4 } }; a[1, 1] = 5;
12. Find the error (if any) in the following code and specify how to correct it or predict the output along with brief explanation:
a. void product(void) {
int a, b, c, result;
printf("%s", "Enter three integers: ")
scanf("%d%d%d", &a, &b, &c);
result = a * b * c;
printf("Result is %d", result);
return result; }
13. Compare Iteration with Recursion.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started