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

18th Jul 2018, 3:05 AM
Tharsyini
Tharsyini - avatar
10 Réponses
+ 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;
18th Jul 2018, 6:38 AM
Babak
Babak - avatar
+ 6
Please elaborate on your question to receive helpful answers.
18th Jul 2018, 5:28 AM
Tashi N
Tashi N - avatar
+ 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.
20th Jul 2018, 8:39 PM
Tashi N
Tashi N - avatar
+ 2
which question? Remember, array indices start counting from 0. Although I don't know which question, that is a common mistake among beginners.
18th Jul 2018, 3:08 AM
Satyam
+ 2
b [2] changes the value of the third element to 42! It doesn't retrieve the third element.
18th Jul 2018, 5:36 AM
Satyam
+ 2
forgive me because I don't anything about c+ + but check this https://code.sololearn.com/cpS1KRi9Z79w/?ref=app
18th Jul 2018, 5:43 AM
Satyam
0
https://www.sololearn.com/learn/CPlusPlus/1625/
18th Jul 2018, 5:32 AM
Tharsyini
Tharsyini - avatar
0
In the Accessing Array Elements.. in the given example, the b[2] should be 62 right? because its in the 2nd counting..
18th Jul 2018, 5:35 AM
Tharsyini
Tharsyini - avatar
0
Kindly please explain me how it will change? to 42
18th Jul 2018, 5:38 AM
Tharsyini
Tharsyini - avatar
0
ok
20th Jul 2018, 10:50 PM
Aurang Zeb
Aurang Zeb - avatar