Dana Vrajitoru
C201/I211 Computer Programming II

Homework 3

Due Date: Wednesday, September 20, 2006.

Ex. 1 Download the following file:
pointers.cpp

Complete the body of the function Find_largest_factor that should find the largest non-trivial factor of the data referenced by the first parameter p and store that information at the location referenced by the second parameter q. The largest non-trivial factor is the largest factor of a number not equal to itself. For example, for 143 it is 13. If the number is prime, the result should be 1.

Add code to the main in the places marked by the comment
// For the student
and follow the instructions in the code in each of these cases.

Show an example of the execution by embedding it in the program as a comment, as usual. Send the modified pointers.cpp file by email.