+ 26

[ASSIGNMENT] Check Whether a Number can be Expressed as Sum of Two Prime Numbers

Example to check if an integer (entered by the user) can be expressed as the sum of two prime numbers of """"all possible"""" combinations with the use of functions. Note: A prime number is a positive integer which is divisible only by 1 and itself. For example: 2, 3, 5, 7, 11, 13 P.S: i have already put this as an assignment

17th Mar 2018, 7:53 PM
Baraa AB
Baraa AB - avatar
12 Answers
+ 25
//old code , so don't mind so many lines of code for simple things 😛 https://code.sololearn.com/czTIFjtzn23y/?ref=app
17th Mar 2018, 8:09 PM
Gaurav Agrawal
Gaurav Agrawal - avatar
18th Mar 2018, 12:23 AM
LukArToDo
LukArToDo - avatar
+ 15
https://code.sololearn.com/cKlhNxsB5Oah/?ref=app
17th Mar 2018, 7:53 PM
Baraa AB
Baraa AB - avatar
+ 10
@Jayden thanks bro <3 wait your code ;-)
17th Mar 2018, 8:10 PM
Baraa AB
Baraa AB - avatar
18th Mar 2018, 1:41 PM
Neelarghya Kundu
Neelarghya Kundu - avatar
+ 5
Python..no short paths this time 😀😉 https://code.sololearn.com/cY9n6QWM2bw5/?ref=app
18th Mar 2018, 4:18 AM
Zoetic_Zeel
Zoetic_Zeel - avatar
+ 5
It was a easy one but little bit tricky. Here is my try :- If any bugs found please comment. https://code.sololearn.com/cR2EN348BpkP/?ref=app
20th Mar 2018, 4:26 AM
Mr.Curious
Mr.Curious - avatar
+ 4
https://code.sololearn.com/c8Xi6VMLidBt/?ref=app here I posted my program for checking a number as sum of prime.
18th Mar 2018, 7:03 AM
Durg@😊
18th Mar 2018, 11:26 AM
Abhimanyu Gupta
Abhimanyu Gupta - avatar
+ 4
Oneliner. Gives all the solutions https://code.sololearn.com/c7fBc1j2vDj6/?ref=app
18th Mar 2018, 3:56 PM
VcC
VcC - avatar
+ 3
This is related to the Goldbach Conjecture that states that every perfect square can be expressed as a sum of two primes. For Example: 9 = 3^2 = 2+7 16 = 4^2 = 3 + 13 = 5 + 11 This has neither been proven or disproven till now. Perhaps, if you can prove(or disprove) this conjecture, you will become famous!
2nd May 2018, 3:52 AM
Naveen Maurya
Naveen Maurya - avatar
0
OldEn Days Code
18th Mar 2018, 6:49 AM
Shalom James
Shalom James - avatar