Question: a) Write a suitable C function to satisfy the following: i. The name of the function is community. ii. When it is called, it

a) Write a suitable C function to satisfy the following: i. The

 

a) Write a suitable C function to satisfy the following: i. The name of the function is community. ii. When it is called, it will return a floating point number. iii. The function would accept 3 integer numbers, num1, num2, and num3. iv. The algorithm for the function is as below: 1. If num1 and num2 are equals, the function will return num3. [5 m] 2. If num1 is greater than num2, the function will return num1 * num2 - num3. 3. If num1 is less than num2, and num3 is not equal to zero, the function will return floating point value of (num1 + num2) num3, otherwise it will print "sorry, division by zero" and return 0.0

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Heres a C function named community that satisfies the given requirements c include stdio h float com... View full answer

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 Programming Questions!