Write a program in C to Check Whether a Number can be Express as Sum of Two Prime Numbers.
Sample Run :
Input a positive integer: 16
Expected Output :
16 = 3 + 13
16 = 5 + 11
Write a program in C to Check Whether a Number can be Express as Sum of Two Prime Numbers.
Sample Run :
Input a positive integer: 16
Expected Output :
16 = 3 + 13
16 = 5 + 11
So where is your attempt?
You can't just roll in, dump your assignment and expect someone to give you an answer on a plate. It doesn't work like that.
http://cboard.cprogramming.com/c-pro...uncements.html
At the very least, you should be capable of reading in the required data into suitable variables.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
I'm pretty sure this is a theorem of natural numbers.. not proved yet for all N but certainly not in question.. Then what's the point of this program? Just make the program print 'True'.
Even if it did the program actually did prove it for the 32 or 64 bit representable integers on a computer, it would not have any tangible benefit. Also I think you might find even proving it for all 16 bit numbers would take a very, very, long time.
Last edited by MacNilly; 11-28-2016 at 07:41 AM.
Goldbach's conjecture (every even integer greater than 2 is the sum of two primes) has been shown to be true up to 2 to the 62 (about 4 billion billion). Note that it's only for even numbers (since most primes are odd and you're adding two of them together).
Wait.. most primes are odd? I thought all primes are odd... cause an even number is divisible by 2, contrary to the definition.. excepting the special cases of 0 and 1, I suppose.
Then, maybe a better statement, instead of "most primes are odd" is "all primes except 2 are odd".