I'm doing an excerise to make factions, but I need to simulate a \frac{}{}(adsbygoogle = window.adsbygoogle || []).push({});

command. To display numbers in faction AND decimal form. How do I simulate a

\frac{}{} command? Thanks. Like I have to prompt the user.

Code (Text):int denominator, numerator;

scanf("\\frac{%d}{%d}", &numerator, &denominator);

cout << numerator << " / " << denominator;

Enter fraction in the form n1/n2:

1

\frac{1}{2} is --

2

or 0.5

how do I make it to decimal?

**Physics Forums - The Fusion of Science and Community**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Making a number to decimal form

Loading...

Similar Threads - Making number decimal | Date |
---|---|

Making a browser extension | Aug 17, 2017 |

Python Making my web page publicly available | Jul 29, 2017 |

How can I make a custom bootstrap navigation bar? | Mar 6, 2017 |

Trying to make a program to take and print the natural log of a number input | Dec 8, 2011 |

Is there chance to make computer with base-3 number system ? | Jul 21, 2011 |

**Physics Forums - The Fusion of Science and Community**