Question: PROGRAMMING IN C 1. Given the array a, write an expression that refers to the first element of the array. 2. Assume that an array

PROGRAMMING IN C

1. Given the array a, write an expression that refers to the first element of the array.

2. Assume that an array of int variables named salarySteps that contains exactly five elements has been declared.

Write a single statement to assign the value 30000 to the first element of this array.

3. Given an array temps of doubles, containing temperature data, and an int variable n that contains the number of elements in temps, compute the average temperature. Store the average in a variable called avgTemp. Besides temps, n, and avgTemp, you may use only two other variables --an int variable k and a double variable total, which have been declared.

4. Write a statement that declares a prototype for a function printArray, which has two parameters. The first parameter is an array of ints and the second is an int, the number of elements in the array. The function does not return a value.

5. Write the definition of a function printArray, which has two parameters. The first parameter is an array of ints and the second is an int, the number of elements in the array. The function does 1qnot return a value. The function prints out each element of the array, on a line by itself, in the order the elements appear in the array, and does not print anything else.

Step by Step Solution

3.49 Rating (149 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Question 1 a0 Explanation The first element of the array is stored at the 0t... 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!