Goldbach's conjecture in mathematics is that every even integer number greater than 2 can be expressed as the sum of two prime numbers. Write a program that prompts the user for a number, checks that it is positive and even, and prints the two primes that sum to it.
First I have a question: Is there a mistake? Maybe an even number adds up to 3 primes summed up or even more?
Then... Here's how far I've gotten:
#include <stdio.h>
#include <math.h>
int even (int number);
int prime (int number);
int
main ()
{
int number, sum=0, divisor;
printf ("Please enter a whole number: ");
scanf ("%d", &number);
if (number>=1)
{
prime (number);
}
return (0);
}
int even (int number)
{
return (!(number%2));
}
int prime (int number)
{
if (even (number))
{
I've been stuck here for a while now...
Any hints would be appreciated!
Thank you in advance!