EDIT*
I figured it out and got my code to work. It simplifies the fraction correctly, only problem now is it prompts the user to input a fraction twice
Welcome to fraction simplifier
You will be asked to enter a fraction in the form integer / integer
The program will then attempt to calculate and display
the simplified form of the fraction
Enter a fraction in the form (x/y): (For example, 20/100)
3/9
Enter a fraction in the form (x/y): (For example, 20/100)
4/16
The original fraction you entered was 4 / 16
The simplified version of the fraction is 1 / 4
Im writing a program to simplify a rational fraction to its simpliest form. I have my code completed and running with no errors, but its doing some weird things..printf and scanf are new to me so Im not sure who else to rearrange or change my code..
Im think the errors have to do with either one of these two functions i wrote:
1 2 3 4 5 6 7 8 9 10 11
Fraction getFraction()
{
int numer, denom;
Fraction userFraction;
printf("Enter a fraction in the form (x/y): ");
printf("(For example, 20/100)\n\n");
scanf("%ld/%ld", &userFraction.numer, &userFraction.denom);
return userFraction;
}