**int FirstPart (pair p) ;**-
This function returns the first integer in the pair value
`p`. **int SecondPart (pair p) ;**-
This function returns the second integer in the pair value
`p`. **pair MakePair (int one, int two) ;**-
This function makes a pair value whose first part is the
value contained in
`one`and second part is the value contained in`two`.

~chang/pub/cs201You should copy this file as well as the files

**int Numerator(pair p) ;**-
Return the numerator of the fraction stored in the pair
`p`. **int Denominator(pair p) ;**-
Return the denominator of the fraction stored in the pair
`p`. **pair MakeFraction(int numer, int denom) ;**-
Make a fraction with numerator
`numer`and denominator`denom`. **pair ReduceFraction (pair p) ;**-
Given a fraction stored in
`p`, reduce the fraction to the normal form by dividing the numerator and denominator by their greatest common divisor. For example, 6/8 becomes 3/4. You should use Euclid's GCD algorithm for this function. The function then returns the reduced fraction. **void PrintFraction (pair p) ;**-
Print out the numerator and denominator of the fraction
`p`. We need this since`printf`does not print out pairs. The output is sent directly to the screen, so this function does not return any values. The output should be of the form numerator/denominator; for example, 3/4. **pair AddFraction (pair p, pair q) ;**- Given two fractions, return the sum of the fractions. The result should be put in normal form, using ReduceFraction.
**pair SubtractFraction (pair p, pair q) ;**-
Given two fractions
`p`and`q`, return the result of`p`-`q`. The result should be put in normal form, using ReduceFraction. **pair MultiplyFraction (pair p, pair q) ;**- Given two fractions, return the product of the fractions. The result should be put in normal form, using ReduceFraction.
**pair DivideFraction(pair p, pair q) ;**-
Given two fractions
`p`and`q`, return the result of`p`divided by`q`. The result should be put in normal form, using ReduceFraction.

% cc201 proj3.c main3.o pair.oThe output of the complete program should look like:

Testing: 2, 3, 3, 4 Reduce: 2/3 = 2/3 Reduce: 3/4 = 3/4 (2/3) + (3/4) = 17/12 (2/3) - (3/4) = -1/12 (2/3) * (3/4) = 1/2 (2/3) / (3/4) = 8/9 Testing: 3, 4, 1, 8 Reduce: 3/4 = 3/4 Reduce: 1/8 = 1/8 (3/4) + (1/8) = 7/8 (3/4) - (1/8) = 5/8 (3/4) * (1/8) = 3/32 (3/4) / (1/8) = 6/1 . . .

- Read the assignment. A lot of you go to office hours to ask questions can be answered by reading the assignment. This is perfectly fine if you don't understand the assignment, but you will save yourself a lot of time by reading the assignment first.
- You should test your functions before you try to put them
together with
`main3.o`. To do this, you will have to write your own driver programs that call the functions. - You will need to include the header files
`stdio.h`and`proj3.h`in your file, even though your won't have a main function in this file.

Last Modified: June 23, 1994 Richard Chang, chang@gl.umbc.edu