code in c assignment

There are two parts to this assignment, though not connected, but should be implemented in the same file to simplify.

Get Your Custom Essay Written From Scratch
We have worked on a similar problem. If you need help click order now button and submit your assignment instructions.
Just from $13/Page
Order Now

1. Write code for a function that receives two parameters (a,and b) by value and two more parameters (c and d) by reference. All parameters are double.
The function works by assigning c to (a/b) and assigning d to (a*b). The function has no return value.

From main, use scanf to get two numbers, then call the function, and then display both outcome values to the output in a printf statement.

2. After part 1 is completed, write code to get 20 integer numbers from the user. The code then displays how many of those numbers are above the average. To get proper credit you must follow these steps:

a. write a for loop to fill the array with numbers from the user. Use an array for this.

b. use a pointer to calculate the average of the numbers entered into the array of part a above, in another loop.

c. write a function, then pass the array, its size, and the average to that function. The function arguments would be a pointer to int, an int, and a float and it returns the count of the number of elements that are above the average.

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published.