Question: 5. Program the following in one C file with one main function: a. [3 points] For this part, your program prompts the user for
5. Program the following in one C file with one main function: a. [3 points] For this part, your program prompts the user for four integers. The program finds the smallest integer and prints it on the console. Your program also prints whether the smallest integer is a multiple of 3. To achieve the above mentioned functionality, your program must use two C functions with the following prototypes: i. int smallest(int num1, int num2, int num3, int num4); This function returns the smallest of num1, num2, num3, and num4; ii. int isMultipleOf3(int number); This function returns 1, if number is a multiple of 3. Otherwise, it returns 0. b. [2 points] For this part, your program prompts the user for two different integers. The program prints the average value of all the odd integers between the two values entered by the user. An odd integer is not divisible by 2. Average is calculated by dividing the sum of odd integers by the total number of odd integers. To achieve the above mentioned functionality, your program must use a function with the following prototype: i. double oddAverage(int a, int b); This function returns the average of all odd integers between a and b.
Step by Step Solution
3.46 Rating (143 Votes )
There are 3 Steps involved in it
Answer Heres a C program that fulfills the specified requirements include Function prototypes int sm... View full answer
Get step-by-step solutions from verified subject matter experts
