+ 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
5 Answers
+ 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
Hot today
Python โ File Handling
2 Votes
Help me
0 Votes
Question is write a c program to print prime numbers up to n and print the largest number in array.
1 Votes
Whatโs wrong?
2 Votes
Achievements on Sololearn
1 Votes
Queue & dequeued
0 Votes