+ 2
How can I write a c++ program that will be able to add fractions
5 Answers
+ 2
fractions?the only i think of is converting to decimals summing it up,and re-expressing it as a fraction
+ 2
Make a fraction templated struct/class and then a function that adds the numerators of such objects
+ 2
Here's a solution for you.
It allows adding and multiplying of fractions, and simplifies the fractions along the way:
https://code.sololearn.com/cL9J1KB2dr41/#cpp
+ 2
https://code.sololearn.com/cKhLJHkLvEv7/?ref=app
0
thank you guys