+ 26
Java Challenge question
Can anyone explain me how the ans is 51? I lost in java Challenge. https://code.sololearn.com/cb1bkBG4VG8U/?ref=app
14 ответов
+ 18
Eshan Khan here is the java course on sololearn
https://www.sololearn.com/Course/Java/?ref=app
+ 14
Netha_r2071 yeah i got your point 👍
+ 5
pix[ind]=i+j; and with the for loop
150 = i + j*100 that means shall be j = 1 and i = 50
pix[150]=i+j = 51
+ 4
And I thought it was returning garbage value, at 5100 it returns 51, and for index 20 it returns 20
+ 3
Lamya
I + j = value
I + j * 100 = index
I => 50
j => 1
I + j => 51
ind => I + j * 100 => 150
It concludes that
pix[ind] = 51
Any doubt, don't think about how array is getting filled.
DHANANJAY PATEL
+ 2
~ swim ~
Thank you !!!
It's for earning or participation only !!!
I am earning my bage, I had earned during past life.
That's why I am working on SoloLearn.
Please, don't mind on my coment it's for the sack of future projects.
It is for well being.
Be Good Citizen.
+ 2
~ swim ~
Leaving this kind of thread.
DHANANJAY PATEL
+ 2
Lamya😉 ["非活性"] there is no difficulty, when i=50 and j=1,we get pix[ind]=51.
Just to get a clear idea to u, just cross check the values of pix[ind]=50,for i=50 and j=0,just understand the logic, hope this helped :)
0
How to learn java on sololearn
0
In depth knowledge is required in makers and bussy points.
Bye for now.
I am with Davis it's ancient and non ethnic person name.
Slow and study needs remarkable work. Disappointment is there two.