jdjxbxnshd8048 jdjxbxnshd8048
  • 20-02-2020
  • Computers and Technology
contestada

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

Respuesta :

frknkrtrn
frknkrtrn frknkrtrn
  • 20-02-2020

Answer:

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]

Answer Link

Otras preguntas

What is the slope of the line passing through the points (-3, 4) and (2, - 1)?​
Ms. Abramson, who is a recruiter for a company, thinks that only Chinese people should be hired because they are harder workers than Mexicans. At what point doe
describe the different stages of the rock​
What is the name of the thin glass plate placed on top of a specimen?
1. Who was the first territorial governor of Washington? 2. What treaty did Chief Seattle sign? 3. Where in Canada was gold discover? 4. Explain what Native Ame
how much time will it take a roller skater to travel 300 m at a speed of 15m/s
How did Zeus’s gift of curiosity affect pandora
write a real-world problem that can be modeled by 4 x (-7).
Sammy has $140 he’s planning on saving an additional $10 each week write an equation to represent the total amount of money M he would save after W weeks
what is 7 x 3/9 plz