0
How to convert decimal number in fraction in CPP?
eg:- how to convert any number X in the form p/q?
2 Respuestas
0
Find out what is your fraction in base 10, e.g. 0.75 = 75/100, 0.085 = 85/1000
Divide both numerator and denominator by __gcd(numerator, denominator) to simplify the fraction.