5. Program the following in one C file with one main function: a. [3 points] For...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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. 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.
Expert Answer:
Answer rating: 100% (QA)
Answer Heres a C program that fulfills the specified requirements include Function prototypes int sm... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
4. Time Again LLC produces and sells a mantel clock for $100 per unit. In 2017, 41,000 clocks were produced and 37,000 were sold. Other information for the year includes: Direct materials $42 per...
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1-5. Ivan's grandfather died and left a portfolio of municipal bonds. In 2012, they pay Ivan...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
The property is located at the intersection of two heavily traveled major arteries. It is a new, glass-walled, five-story office building containing 50,000 total square feet-40,000 of which is...
-
Goo-Yeong Limited sells equipment on September 30, 2015, for $42,000 cash. The equipment originally cost $144,000 when purchased on January 1, 2013. It has an estimated residual value of $4,000 and a...
-
Earnhart Corporation has outstanding 3,000,000 ordinary shares with a par value of $10 each. The balance in its retained earnings account at January 1, 2022, was $24,000,000, and it then had Share...
-
Many sample motions can be found using a basic web search. Search for an actual motion to continue a trial or hearing date pertaining to a civil case in California. The party moving to continue must...
-
Refer to Problem P22- 47B. Additional data for Beta Batting Company: a. Capital expenditures include $ 40,000 for new manufacturing equipment, to be purchased and paid in the first quarter. b. Cash...
-
Critically examine how Clayton Christensen s notion of disruptive technology extends our understanding on why new entrants might have an advantage over an industry\'s incumbent firms in developing...
-
A) Using an appropriate definition for sustainable development, discuss ONE opportunity and TWO threats to achieving sustainable development in the Caribbean region. B) Using two characteristics of...
-
Jill Company owns an equity investment in Jack Company and it is being properly reported using the equity method. Here is the relevant data from the first year of ownership: % of Jack's stock owned...
-
Factor completely. 3c9/5 - 3c4/5
-
State which are roots for the following polynomial. 2. f(x) = x + x - 8x - 12 -12 -2 0 3 Yes No
-
Colin claims that he has found a safe way to jump off the Shanghai Tower. His plan is to take a wooden chair to the top of the tower, stand on the chair, and have a friend slide him and the chair off...
-
Question 15 of 25. In order to comply with federal banking regulations, you must complete and pass this training course prior to undertaking any bank representative related activities. OTRUE FALSE...
-
5 (3pts). Consider the wave equation ut ur for all -0 < x 0 with the initial conditions u(x,0) = e-l and u(x,0) = 0. Using the Fourier transform, show that the wave equation has a solution of...
-
Give the structural formulas of the alkenes that, on ozonolysis, give: a. (CH3)2C=O and CH2=O b. Only (CH3CH2)2C=O c. CH3CH=O and CH3CH2CH=O d. O=CHCH2CH2CH2CH=O
-
Karim Depak received a Form 1099-B showing the following stock transactions and basis during 2012: None of the stock is qualified small business stock. Calculate Karim's net capital gain or loss...
-
Jason and Mary are married taxpayers in 2012. They are both under age 65 and in good health. For this tax year, they have a total of $41,000 in wages and $500 in interest income. Jason and Mary's...
-
John Fuji (age 37) moved from California to Washington in December 2011. He lives at 468 Cameo Street, Yakima, WA 98901. John's Social Security number is 571-78-5974 and he is single. His earnings...
-
Use the Bonferroni test from Chapter 16 to elaborate on the results of Exercise 17.4. Exercise 17.4 The interaction in the analysis for Exercise 17.3 suggests that it would be profitable to examine...
-
The interaction in the analysis for Exercise 17.3 suggests that it would be profitable to examine simple effects. Compute the simple effects for the differences due to Strategy within each time...
-
Why might it not make much sense to examine the results for heterogeneity of effects?
Study smarter with the SolutionInn App