How does this segment of code result in 1,2,1,2 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How does this segment of code result in 1,2,1,2

Int m1[] = {{2,1},{2,1}}; for(int i = 1; i > -1; i- -); for(int j = 1; j > -1; j- -); System.out.print(m1[i][j]); https://www.sololearn.com/discuss/1316935/?ref=app https://code.sololearn.com/WR083Wx43bTa/?ref=app

15th Aug 2018, 7:49 PM
Ralph
3 Answers
+ 7
I don't have a clue why you bothered to link the code or thread as they have nothing to do with your question... The code in question prints m1[1][1] m1[1][0] m1[0][1] m1[0][0] Therefore: 1212
15th Aug 2018, 8:48 PM
John Wells
John Wells - avatar
+ 2
how do i make the question appropriate ? everyone complains like its the end of the world
16th Aug 2018, 2:52 PM
Ralph
0
Hi Ralph , Your question is appropriate and there is no need to mention irrelevant posts in your question to make it appropriate. What problem did you face here, pls tell me?
17th Aug 2018, 7:55 AM
Sachin Artani
Sachin Artani - avatar