fraction

Jun 16, 2016 at 5:05pm
Hello,can me anybody help??? I'm need to make fraction and them addition. For example 2/3 + 3/5. I did the wrong therefore appeal to you
Jun 16, 2016 at 7:14pm
mimick the steps you would do on a piece of paper with code:

1. Find LCM (least common multiple) of denominators
2. Change fractions to have denominator of LCM and numerator of original numerator*(LCM/original denominator)
3. Add numerators
4. Find GCD (greatest common denominator) of resulting numerator and denominator.
5. divide numerator and denominator by the GCD

Are there faster ways to do this? Yeah, but this works ( I think )

EDIT: I took out the code I wrote because it would probably be best for you to write it instead
Last edited on Jun 16, 2016 at 7:30pm
Topic archived. No new replies allowed.