0
Is this logic is wrong or problem in code syntax
https://sololearn.com/compiler-playground/crkcCwF4hvjY/?ref=app
3 Réponses
+ 2
Your syntax and logic are wrong. And missing many semicolons here is right code
https://sololearn.com/compiler-playground/c1U5uriXo7oe/?ref=app
0
Sword đȘ What wrong in logic can you please explain
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