1. fractions and whole numbers

How do I get a program to simplify a fraction, and how do I get a program to recognize if a fraction is a whole number? There is probably a simple solution, but I am oblivious. Thanks alot.

2. For the whole number thing you could just divide the two numbers and if that is+ 1 then...

Code:
```no.3 == no.1 / no.2;
if (no.3 == 1) {
//stuff
}
else {
//stuff
}```

3. sorry, but I meant if a number is a whole number

4. yes if you divide the two numbers in the fraction and they equal one then it is a whole number.
20/20 is a whole number 20/20 = 1

5. Ah right I might have got you:

if no.1 > no.2

6. yeah, and 1.2/1.2=1, and 1.2 isn't a whole number

7. fractions cannot be 1.2 end of

8. you cannot have 1.2/1.2 it does nto make mathematical sense!

9. C++ converts fractions to decimal representation and automatically simplifies to lowest term.

Code:
`cout << 3.0/9.0;`
Results in .3333333 what is 1/3, not 3/9 (which 1/3 is just the simplified form).

It also automatically recognizes if it is a whole number.

Code:
`cout << 8.0/4.0;`
Gives you 2, not 2.0000000

10. No, you don't understand. I want the program to test if a number is a whole number. it will only accept integers. so if it isn't supposed to output numbers like 1.2, but it can output numbers like 56.

11. you cannot have 1.2/1.2 it does nto make mathematical sense!
It makes perfect mathmatical sense.
1.2 is just 1 and 1/5, or 6/5

6/5 over 6/5 is perfectly legal. Or (6/5) / 9 is perfectly legal.

12. How do I convert decimals back to fractions?

13. yes but you cannot have 1.2/1.2

14. 1.2/1.2 == 1/1 == 1

15. you cannot have 1.2/1.2 it does nto make mathematical sense!
Why not?