Stack Overflow Asked on December 6, 2020

Please help me with my code!

```
#include <stdio.h>
void reduce(int numerator, int denominator, int *reduce_numerator, int *reduce_denominator);
int gcd;
int *reduce_numerator, *reduce_denominator;
int main(void){
int numerator,denominator;
printf("Enter a fraction:");
scanf("%d/%d", &numerator, &denominator);
int new_numerator, new_denominator;
reduce_numerator = &numerator;
reduce_denominator = &denominator;
reduce(numerator, denominator, reduce_numerator, reduce_denominator);
new_numerator = numerator / gcd;
new_denominator = denominator / gcd;
printf("%d%d", new_numerator, new_denominator);
reduce_numerator = &new_numerator;
reduce_denominator = &new_denominator;
printf("In lowest terms:%d/%d", *reduce_numerator, *reduce_denominator);
int result = numerator / denominator;
printf("The value is:%d", result);
return 0;
}
void reduce(int numerator, int denominator, int *reduce_numerator, int *reduce_denominator){
int gcd, remainder;
while(*reduce_numerator!=0){
remainder = *reduce_denominator % *reduce_numerator;
*reduce_denominator = *reduce_numerator;
*reduce_numerator = remainder;
}
gcd = *reduce_denominator;
}
```

I don’t know the reason that I can’t recall the function in the "main function", so if anyone know, please help me and let me understand, thanks very much!

p.s. The "reduce" function as well as its form are requested to have!

Get help from others!

Recent Answers

- Jon Church on Why fry rice before boiling?
- haakon.io on Why fry rice before boiling?
- Lex on Does Google Analytics track 404 page responses as valid page views?
- Peter Machado on Why fry rice before boiling?
- Joshua Engel on Why fry rice before boiling?

Recent Questions

- How can I transform graph image into a tikzpicture LaTeX code?
- How Do I Get The Ifruit App Off Of Gta 5 / Grand Theft Auto 5
- Iv’e designed a space elevator using a series of lasers. do you know anybody i could submit the designs too that could manufacture the concept and put it to use
- Need help finding a book. Female OP protagonist, magic
- Why is the WWF pending games (“Your turn”) area replaced w/ a column of “Bonus & Reward”gift boxes?

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP