Zfmain

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

1 #include <iostream>

2 #include "Fraction.h"
3 using namespace std;
4
5 int main()
6 {
7 Fraction a(28,12);
8 Fraction b(2);
9 Fraction c,d,t;
10 cout <<"la premiere fraction: "<<a<<endl;
11 cout <<"La deuxieme fraction: "<<b<<endl;
12 cout <<"La troisieme fraction: "<<c<<endl;
13 cout <<"La quatrieme fraction: "<<d<<endl;
14 c=a+b;
15 t=a-b;
16 cout <<"t: "<<t<<endl;
17 cout <<"La somme a+b: "<<c<<endl;
18 d=a*b;
19 cout <<"Le produit a*b: "<<d<<endl;
20 if(a<b)
21 {
22 cout <<"a<b "<<endl;
23 }
24 else if(a==b)
25 {
26 cout <<"a=b "<<endl;
27 }
28 else
29 {
30 cout <<"a>b "<<endl;
31 }
32 cout <<1/a<<endl;
33 return 0;
34 }

You might also like