hmwk1_prob_ch - Name Red ID Problem Statement All includes...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
COMPE271 Homework 1 Due on 6/_ /2010 Question: A twin prime is a prime number that is exactly two larger than the largest prime number that is smaller than it. For example, 7 is a twin prime because it is exactly two larger than 5. But 17 is not a twin prime because the largest prime less than 17 is 13. Write a program that asks the user how many twin primes the user wants to find, reads in that goal, and then successively examines the numbers starting at 2 to see if the number is a twin prime. The program stops when the specified number of twin primes has been found. It then prints out the twin primes found. Coding Standards: Your code should be developed using the following template and directions.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: /*********************************************************************/ /* Name : * Red ID : * Problem Statement : * * *********************************************************************/ /* All includes and definitions should be made here */ /* For all functions follow the following template /*********************************************************************/ /* Function Name * Input variables * Output variables * Function definition *********************************************************************/ returntype functionname ( arg1, arg2, …) { // Please include as much comment as possible } int main ( arguments ) { // comments and more comments }...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online