![]() |
Help Needed: Nothing is Printed
Code:
using namespace std; |
Re: Help Needed: Nothing is Printed
one error is this ---> while (s == sign(f(x))) {
and another is this -->return x*x - 1; |
Re: Help Needed: Nothing is Printed
I fixed those errors (thanks for catching those, by the way), but still nothing is being printed.
|
Re: Help Needed: Nothing is Printed
Found the error :)
Change : Code: CPP
Code: CPP
First, you are trying to initialize a global var root outside any procedure. Second, the vars that you pass as args : a, b, h to FindRoot are un-initialized ! Change the code and it should print. |
Re: Help Needed: Nothing is Printed
Place this line
Code: cpp
|
Re: Help Needed: Nothing is Printed
another error is this
Quote:
No command is executed after a return!!! and of course as davidk and SaswatPadhi said change your code like this Code:
using namespace std; |
Re: Help Needed: Nothing is Printed
Thanks for all the help guys! I finally got it right with a little input from my instructor though. But again, thanks for taking the time to help.
|
| All times are GMT +5.5. The time now is 01:35. |