Question: please answer all questions and explain. (programming in c) Problem 6. Chapter 5.5, Exercise 3. 3. What is the error? int schedule(char activity ) int

 please answer all questions and explain. (programming in c) Problem 6.

please answer all questions and explain. (programming in c)

Problem 6. Chapter 5.5, Exercise 3. 3. What is the error? int schedule(char activity ) int i; float time; int activity; Problem 7. Programming Exercises 5.7. Write a short function power that expects two arguments, x and n, and returns x to the power n. The argument x is of type double, and n is of type int. Problem 8. 5.2. Write a program that prompts the user for two integers and one of the letter codes a, s, m, or d. The interpretation is given by the following table: Letter Meaning add subtract multiply divide The function main issues the prompt and stores the user's input in the variables num, num2, and operator. Then main checks the letter code. If the letter code is a, main invokes the function add with arguments num and num2 and similarly for s, m, and d. Each of the functions add, subtract, multiply, and divide invokes the function print_result, which prints the result of the arithmetic operation. Problem 9. Section 5.6, Exercise 13. 13. The following are two definitions for a macro that picks the maximum of two num- bers. Which is better, and why? Give an example to illustrate your preference. #define MAX1 ( numi, num2) (numi > num2 ? numi : num 2 ) #define MAX2( num1, num2) ((numi) > (num2) ? (numi): (num2)) Problem 10. Section 5.6, Exercise 15. 15. What is the error in the following attempt to define a parameterized macro max

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!