Ask Question

Assume that an array named salarySteps whose elements are of type int and that has exactly five elements has already been declared. Write a single statement to assign the value 30000 to the first element of this array.

+1
Answers (1)
  1. 6 January, 16:08
    0
    The answer is "salarySteps[0] = 30000; "

    Explanation:

    In the question is it define that salarySteps[] is an array variable that accepts an integer value because it datatype is int. In this array five elements are already declared so, the code for assign value that is "30000" in array first elements is "salarySteps[0] = 30000; ".

    array index starts with 0 and ends with n-1 so, we use array[0] for assign value. It is a collection of homogeneous elements that means it collects only one type of value at a time like a number, characters, and string, etc.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Assume that an array named salarySteps whose elements are of type int and that has exactly five elements has already been declared. Write a ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers