Lab 1 Fraction addition
 
Write a program in the C/C++ programming language to input and add two fractions each represented as a numerator and denominator. Do not use classes or structures. Print your result (which is also represented as a numerator/denominator) to standard out. If you get done early, try to simplify your result with the least common denominator. The following equation can be used to add fractions:

 

a/b + c/d = (a*d + b*c)/(b*d)

 

Example:

 

1/2 + 1/4 = ( 1(4) + 2(1) ) / 2(4) = 6/8 = 3/4

Compile your C/C++ program with the following command (assume your program is saved as lab1.C or lab1.cpp)
 
jdoe@shaula% g++ o lab1 lab1.C (or lab1.cpp)
 
To execute your program:
 
jdoe@shaula% lab1