Why this code show warning ? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

Why this code show warning ?

Warning in last "for šŸ”„" https://code.sololearn.com/c8yUH94wtkZg/?ref=app

13th Apr 2022, 4:57 AM
Yogeshwaran P
Yogeshwaran P - avatar
2 Respostas
+ 5
Well, the compiler kindly told you why, didn't it :) Line 26, in the for loop header. There you combine two conditions with a comma. That causes the evaluation of the first expression to be discarded, which is not what you want. You want both conditions to be true. For that you need to use the AND operator: && Line 26: i <= n && j < n
13th Apr 2022, 5:26 AM
Ani Jona šŸ•Š
Ani Jona šŸ•Š - avatar
+ 2
Ohh thanks alot Ani Jona šŸ•Š
13th Apr 2022, 6:31 AM
Yogeshwaran P
Yogeshwaran P - avatar