Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DNA Databases

Authors: Stefan Kiesbye

1st Edition

0737758910, 978-0737758917

More Books

Students also viewed these Databases questions

Question

How would you describe your typical day at work?

Answered: 1 week ago