PROGRAMMING IN C 1. Given the array a, write an expression that refers to the first element
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 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.
A Survey Of Mathematics With Applications
ISBN: 9780135740460
11th Edition
Authors: Allen R. Angel, Christine D. Abbott, Dennis Runde