0% found this document useful (0 votes)
0 views1 page

Program Description

The document describes a program that identifies pairs of odd prime numbers that sum up to a given even number 'N', where 1 <= N <= 50. It explains that every even number greater than 4 can be expressed as the sum of two odd primes, providing examples of valid inputs and their corresponding outputs. Additionally, it specifies that odd inputs are invalid and should return an error message.

Uploaded by

7emehak
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views1 page

Program Description

The document describes a program that identifies pairs of odd prime numbers that sum up to a given even number 'N', where 1 <= N <= 50. It explains that every even number greater than 4 can be expressed as the sum of two odd primes, providing examples of valid inputs and their corresponding outputs. Additionally, it specifies that odd inputs are invalid and should return an error message.

Uploaded by

7emehak
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

PROGRAM 1:

A number is said to be a Goldbach number, if the number can be expressed as the addition of
two odd prime number pairs. If we follow the above condition, then we can find that every
even number larger than 4 is a Goldbach number because it must have any pair of odd prime
number pairs.

Example: 6 = 3, 3 (ONE PAIR OF ODD PRIME)

10 = 3, 7 & 5, 5 (TWO PAIRS OF ODD PRIME)

Write a program to enter any positive EVEN natural number ‘N’ where (1<=N<=50) and
generate odd prime twin of ‘N’.

Test your program for the following data and some random data.

Example 1
INPUT: N = 14
OUTPUT: ODD PRIME PAIRS ARE: 3, 11
7, 7
Example 2
INPUT: N = 20
OUTPUT: ODD PRIME PAIRS ARE: 17, 3
13, 7
Example 3
INPUT: N = 44
OUTPUT: ODD PRIME PAIRS ARE: 41, 3
37, 7
31, 13

Example 4
INPUT: N = 25
OUTPUT: INVALID INPUT

You might also like