0
it's supposed to be b[2] is 62 right?
why in this question put as 42? Please check this: https://code.sololearn.com/cpS1KRi9Z79w/?ref=app
10 Respostas
+ 4
Tharsyini
In the first place, the provided array has been initialized with a definitive set of integers as
int b[5] = {11, 45, 62, 70, 88};
This particular array consists of 5 elements with an index-value relation as
b[0] = 11
b[1] = 45
b[2] = 62
b[3] = 70
b[4] = 88
Later on, each and every of the element can be changed as S. C. demonstrated it in his code (since it's not a const array). So, chances are the b[2]'s value gets manipulated somewhere in the code and became 42 through a direct assignment or loop or something else as
b[2] = 42;
+ 6
Please elaborate on your question to receive helpful answers.
+ 6
Lazzy_aplye
I didn't even say a word about programming here 🤣
Please keep the thread on topic, if you want to chat, move to Discord or use a code comment. Thanks a lot.
+ 2
which question?
Remember, array indices start counting from 0. Although I don't know which question, that is a common mistake among beginners.
+ 2
b [2] changes the value of the third element to 42! It doesn't retrieve the third element.
+ 2
forgive me because I don't anything about c+ + but check this
https://code.sololearn.com/cpS1KRi9Z79w/?ref=app
0
https://www.sololearn.com/learn/CPlusPlus/1625/
0
In the Accessing Array Elements..
in the given example, the b[2] should be 62 right? because its in the 2nd counting..
0
Kindly please explain me how it will change? to 42
0
ok