COMP 221 Fall08 hw1

COMP 221 Fall08 hw1 - COMP 221: Introduction to Computer...

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

View Full Document Right Arrow Icon
COMP 221: Introduction to Computer Systems Project 1: Factors Assigned: 8/28/08, Due: 9/4/08 Important: This project must be done individually. Be sure to carefully read the course policies for assignments (including the honor code policy and the slip day policy) on the assignments page of the course web site: http://www.owlnet.rice.edu/˜comp221/2008/html/assignments.html Overview You will write C code to count the prime factors of a number. The goals of this project are as follows: Write a small amount of C code. Become familiar with compiling C code. Summary You will write two versions of code to count the prime factors of a positive integer greater than 1 (for the purposes of this assignment, you should not consider “1” to be a prime factor of any number): Count all of the prime factors. E.g. 12 has 3 prime factors: 2, 2, and 3. Count the distinct prime factors. E.g. 12 has 2 distinct prime factors: 2 and 3. You will write a different procedure to handle each version. You do not need to write a particularly efficient program (although it should complete in a reasonable amount of time). In particular, a truly efficient version would use some data structure to store previously discovered primes, but you have not yet learned about data structures in C. You will not write an entire program. We provide a basic main function to handle the I/O. Hints
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/11/2011 for the course COMP 221 taught by Professor Cox during the Spring '08 term at Rice.

Page1 / 3

COMP 221 Fall08 hw1 - COMP 221: Introduction to Computer...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online