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 Answers
+ 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