Home > Back-end >  Why ask bosses - this code will run overtime
Why ask bosses - this code will run overtime

Time:06-07

, the problem is prime Numbers and sum, thank you

CodePudding user response:

If (b % j==0) {b -; break; }

CodePudding user response:

Could you tell me why is this,,,

CodePudding user response:

If (b % j==0) this condition does not need to add a curly braces, so break, not always be executed conditions didn't also met then break, lead to the value of b will not change, the infinite loop

CodePudding user response:

After the for loop, if else statements with curly braces, even behind with only one line of code, form good habits of code

CodePudding user response:

I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10581430.html
I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10768339.html
  • Related