How do I see if a variable I entered is an integer?
Hi everyone,
So I'm kinda new to C programming. I took a bit of Java back in high school, but since C is a bit different, I don't know what commands and functions I can use.
I'm trying to write a program as a practice exercise that scans input fractions and prints the sum. It's pretty simple, and I have the basic code down, but I'm trying to modify the code so that it simplifies the fraction.
What I'm trying to do is write an if statement so that if the fraction can be simplified, i.e. the numerator and denominator can both be divided and result in an integer, the program keeps dividing until it can't anymore. So if the numerator or denominator can't be divided into integers anymore, it prints the simplified fraction.
Any thoughts?
Thanks!