+ 3
Its because the function quartic is changing the value of the variable that is defined as a parameter. The real x is not changed rather the x variable inside thr function is changed to the correct value
30th Sep 2020, 5:01 PM
Steve Sajeev
Steve Sajeev - avatar
+ 3
See this Code has been corrected https://code.sololearn.com/cm83I0iDdnvz/?ref=app
30th Sep 2020, 5:02 PM
Steve Sajeev
Steve Sajeev - avatar
+ 3
It is explained in this lesson: https://www.sololearn.com/learn/CSharp/2608/
30th Sep 2020, 5:10 PM
Paul
Paul - avatar
+ 2
Because you didn't assign new value to x. ' x = Quartic(x); ' will solve the problem. Variable x in Quartic function is actually a copy of the original one from main, so the original one (x from main) doesn't change.
30th Sep 2020, 5:01 PM
xxxx