0

Is this logic is wrong or problem in code syntax

https://sololearn.com/compiler-playground/crkcCwF4hvjY/?ref=app

15th May 2025, 6:03 AM
Mobin Shaikh
Mobin Shaikh - avatar
3 Antworten
+ 2
Your syntax and logic are wrong. And missing many semicolons here is right code https://sololearn.com/compiler-playground/c1U5uriXo7oe/?ref=app
15th May 2025, 6:09 AM
SWORD🪄
SWORD🪄 - avatar
0
Sword 🪄 What wrong in logic can you please explain
15th May 2025, 9:03 AM
Mobin Shaikh
Mobin Shaikh - avatar
0
in line 21 no cout keyword used and semicolen is missing line 17 semicolen missing line 9 semicolen missing The logic for checking if a number is prime is incorrect. You should check if i is divisible by any number from 2 to i-1. If it is, then it's not prime if (i / j == i) doesn't make sense in the context of prime checking. https://sololearn.com/compiler-playground/cf02uJ264wVZ/?ref=app
15th May 2025, 9:30 AM
SWORD🪄
SWORD🪄 - avatar