+ 2
Why it doesn't work properly?
This C program takes a number and displays 2 prime numbers which their sum is equal to the number we entered but in the results all the numbers are not prime! Why? prime1(i) + prime2(j) == n https://code.sololearn.com/ciC9chJ7340J/?ref=app
4 Respuestas
+ 1
Oh.. Use the for loop condition <= instead of < in prine function... ,
Or use
for(i = 3; i <= n/2; i += 2){
+ 2
Jayakrishna🇮🇳 for example when u enter 20, the results are:
3 17
7 13
9 11
But 9 is not Prime!!!!
+ 2
Jayakrishna🇮🇳 THANKKKKKK U
0
Not clear..
'All numbers are not prime'
But am getting primes only...