You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
471 B

#include <iostream>
#include "fractions.hpp"
int main() {
int a = 7;
int b = 3;
int c = 1;
int d = 11;
double e = 0.75;
fraction q(a,b);
fraction q2(c,d);
fraction q3(e);
cout << a << "/" << b << '=' << q << endl;
cout << q << "+" << q2 << '=' << q + q2 << endl;
cout << q << "-" << q2 << '=' << q - q2 << endl;
cout << q << "*" << q2 << '=' << q * q2 << endl;
cout << q << "/" << q2 << '=' << q / q2 << endl;
cout << e << '=' << q3 << endl;
return 0;
}