primes program

# primes program - /* * Zornberg, Giselle * gzz57 * 15750 *...

This preview shows pages 1–2. Sign up to view the full content.

Sheet1 Page 1 /* * Zornberg, Giselle * gzz57 * 15750 * EE312-Assignment 3 */ /* This program utilizes the Sieve of Eratosthenes to find all the prime numbers up to a specified integer. THe user inputs a n u m * which represents the number of prime numbers to be displayed. These primes will be displayed in an 8 column, table forma * in ascending order with the lowest prime in row 1, column 1. If there are fewer than 9 values to display, only a single row is * necessary. Next, the a list of primes for which two consecutive prime numbers have a difference of four should be found an d * After this list is outputted, all Consecutive0Prime Sum Prime (CPSP) of order-3 should be calculated and reported. */ #include <stdio.h> #include <math.h> #define MAX_SHRT_INT 32767 /* Maximum value for a short integer #define MAX_PRIMES 3512 /* Maximum number of primes that can be output*/ void sieveAlgorithm (int primes[], short int n) void printArray (int primes[], short int n) void differenceOfFour (int primes[], short int n) void sumOfPrimes (int primes[] main() { short int n = 0 char continue_prompt = 'Y'

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This lab report was uploaded on 03/20/2008 for the course EE 312 taught by Professor Shafer during the Spring '08 term at University of Texas at Austin.

### Page1 / 10

primes program - /* * Zornberg, Giselle * gzz57 * 15750 *...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online