Why is this code not working | Sololearn: Learn to code for FREE!

+1

Why is this code not working

I'm trying to get the prime numbers of a number using this method but it's not working. https://code.sololearn.com/cmBq7PYlz6RT/?ref=app

9/7/2020 4:38:44 PM

Joseph Oritseweyinmi

5 Answers

New Answer

+4

it is just prime(10); And You printing only when if (x % y != 0 && x == y) Which is never going to true since x%y! =0 then it never x==y..

+2

Prime is a function with a parameter you must use it like prime(10); https://code.sololearn.com/c6WOBy9x3XAa/#cs try that

+1

How i am suppose to fix it now

+1

Joseph Oritseweyinmi actually what are you trying here.. What prime numbers of a number..? Example? Prime factors or factors of a number..?

+1

I'm trying to get the prime factors of 10