+ 2
My number pattern code doesn't give me the required answer
My code works fine in code blocks but gives me wrong answer in SoloLearn. What might be the problem? https://code.sololearn.com/cTSnZR5YA09h/?ref=app
3 Answers
0
Your code is fine but Infinite loop because of this
for(int b=0; a<=5; b++) {
Here your checking a<=5 and incrementing b
a is always 0 so Infinite loop...
+ 3
Thanks to all. Now my code works fine
+ 1
b <= 5 in line no 6