0

Why is this showing me this message and how can i fix it

https://code.sololearn.com/cTf5XyMkaBCP/?ref=app

7th Sep 2020, 11:18 PM
Joseph Oritseweyinmi
Joseph Oritseweyinmi - avatar
3 Antworten
+ 3
And for(int j=i-1; i<0 ; j--) i<0 never, true because you are staring from i=2 if it j<0,then if once, then always true, infinite loop. Because you are decreasing j, not I. Check one by one condition... OK. I already added code in your last question.. static bool isPrime(int x) { for( int i=2; i<=x/2; i++) if(x%i== 0) return false; return true; }
7th Sep 2020, 11:43 PM
Jayakrishna 🇮🇳
0
Thanks again for all your hrlp
7th Sep 2020, 11:57 PM
Joseph Oritseweyinmi
Joseph Oritseweyinmi - avatar