+ 1
C program need help
hi, this is probably a REALLY simple mistake. But why is this code not functioning properly? https://www.sololearn.com/compiler-playground/cS1cxt9wlxVK
10 Respostas
+ 3
Yes. Looks like you pass the arguments for fractionToDecimal in the wrong order, ll. 37 and 51.
+ 3
The overall design of those functions is not good by the way. You ought to focus them on what they do, not how they are used in your program. I mean, fractionToDecimal should just take the numerator and the denominator as arguments, nothing else. That function should not be concerned about if those values were calculated and calculated through addition or subtraction. That information is not needed to convert a fraction into a decimal representation, right? Then don't put it in there.
+ 2
Code is cutoff. This is not readable code. Better to post it as link by saving in playground
https://www.sololearn.com/post/75089/?ref=app
+ 1
Would that be Lab3L2? What seems to be the trouble?
+ 1
Wrong assignment in parameters in function definition or in passing.
Use this:
double fractionToDecimal(int numeratorAddition, int numeratorSubtracted ,
int denominatorComputed,
int operationVariable )
better Use a readable short form names for variables.
+ 1
You're a god send, thank you
0
Its Program03, I'm pretty sure I linked it...
0
I'm afraid I don't see it then đ i cannot follow that link from the app...
0
Try now?
- 1
Also this was a stupid assignment and I'm not even supposed to be using if else statements, my teacher wants its a specific way or I wouldn't be writing like this. He doesn't like abbreviated variables, or any normal program ideas. And he's stubborn af