+ 2
What is the difference?
There are 2 similar codes but just one of them works properly... why? https://code.sololearn.com/cg8ouHd1Uvuf/?ref=app https://code.sololearn.com/cE1GNBR2rHH8/?ref=app
7 Antworten
+ 2
Change the print statement (n-1) to (n-i)
+ 3
Change it to if(prime(i) && prime(n - i))
+ 2
VRVivek i finally got it, Thanks
+ 1
In code 2 the if condition is wrong. that's why it's not working.
+ 1
VRVivek which if condition?
+ 1
if(prime(i) && prime(n - 1))
+ 1
VRVivek oh..ok... but still the results are not the same!!!