Skip to content

Commit 97d2f31

Browse files
committed
add: 13-02-24 cpp
1 parent 2bb4ce0 commit 97d2f31

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

06_operator_overloading_and_friend_function/07_fraction.cpp

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,42 @@ Overload the following operators as member or friend:
1313
a. Unary ++ (pre and post both)
1414
b. Overload as friend functions: operators << and >>.
1515
16+
17+
Output :-
18+
19+
>>>>>>>> Enter Two Fraction to Perform Operations <<<<<<<<<
20+
21+
>>>>>>>> Enter First Fraction (f1) <<<<<<<<<
22+
23+
Enter Numerator => 6
24+
25+
Enter Denominator => 23
26+
27+
>>>>>>>> Enter Second Fraction (f2) <<<<<<<<<
28+
29+
Enter Numerator => 8
30+
31+
Enter Denominator => 6
32+
33+
34+
First Fraction => 6/23
35+
36+
Second Fraction => 8/6
37+
38+
++f1 => 7/24
39+
40+
f1++ => 8/25
41+
42+
f2 = ++f1
43+
44+
f1 => 9/26
45+
f2 => 9/26
46+
47+
f2 = f1++
48+
49+
f1 => 10/27
50+
f2 => 9/26
51+
1652
*/
1753

1854
// // Header files
46.7 KB
Binary file not shown.

0 commit comments

Comments
 (0)