View Single Post
Oct28-08, 12:08 PM
Sci Advisor
HW Helper
P: 8,953
C+ Programming Homework Help (Not C++)

Sorry not sure what you mean.
Do you mean how would you write the result of n/d as a fraction? - You could simply printf("%u/%u",n,d)
If you want the fraction n/d as a reduced fraction you will have to write a function to find the common multiple.

ps. there is no need for the decimal() function call, you could just do the sum in the printf.
eg printf("%f",(double)n/d);