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
Step: 1
Question 1 a0 Explanation The first element of the array is stored at the 0t...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started