Ask Question

Which expression adds 1 to the element of array arrayName at index i, assuming the array is of type int? A. + +arrayName[ i ] B. arrayName++[ i ] C. arrayName[ i+ + ] D. None of the above

+3
Answers (1)
  1. 30 December, 17:44
    0
    A. + +arrayName[i]

    Explanation:

    In order to add 1 to the element of an array at the given index, we can use increment operators - + + sign. This operator can be placed either before the variable name or after the variable name. Note that since we deal with an array in this situation, the index of the array needs to be specified.

    In option A, pre-increment operator is used to increment value of arrayName variable at index i, + +arrayName[i]
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Which expression adds 1 to the element of array arrayName at index i, assuming the array is of type int? A. + +arrayName[ i ] B. ...” 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