Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Write a function called avg_eq() that accepts 4 doubles, a, b, c, and d and returns a 1 if the average of a,b and

image text in transcribed 1. Write a function called avg_eq() that accepts 4 doubles, a, b, c, and d and returns a 1 if the average of a,b and c is greater than d, zero otherwise. Test your code by tracing the working of it using the following main function; NOTE THAT YOU MUST ADD ANY REQUIRED \#Include STATEMENTS AND ANY NECESSARY VARIABLE DECLARATIONS IN THE MaIn. YOU MUST ALSO ADD printf STATEMENTS TO THE MAIN AFTER EACH CALL TO avg_eq TO PRINT THE RESULTS. THE OUTPUT SHOULD LOOK LIKE THAT SHOWN BELOW. Failure to add these things to the skeleton main will result in a 5 point deduction. //addincludeshere int avg_eq( double, double, double, double); //function prototype int main(void) ( //add declarations here if needed result = avg_eq (1,3,5,2);// add printf statements after each call to avg_eq to print results result = avg_eq (2,3,4,4); result = avg_eq (10,50,25,30); result = avg_eq (123,987,42,300); ) Trace your code; if correct, the output using the above inputs should be: (1,3,5,2)1(2,3,4,4)0(10,50,25,30)0(123,987,42,300)1 ------------------------------Write your function below the dotted line

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

Professional Microsoft SQL Server 2012 Administration

Authors: Adam Jorgensen, Steven Wort

1st Edition

1118106881, 9781118106884

More Books

Students also viewed these Databases questions

Question

Example. Evaluate 5n+7 lim 7-00 3n-5

Answered: 1 week ago

Question

What is the relationship between diversity, inclusion, and equity?

Answered: 1 week ago