Sep 28, 2014 at 1:35am UTC
For a start you need to set userInput to x. eg float userInput = x; at line 10
Sep 28, 2014 at 3:23am UTC
Get rid of userInput
.
The input comes from main - x and x2. So in the squareRoot function, just use x instead of userInput (which you have now deleted lol)
Sep 28, 2014 at 4:20am UTC
oops again, that was pretty obvious
Sep 28, 2014 at 6:25pm UTC
So you're saying that my code has an error or it's ok?
Anyhow, I have to use assert function in my code, this is some sort of school assignment and I have to demonstrate how I used it.
Last edited on Sep 28, 2014 at 6:26pm UTC
Sep 28, 2014 at 6:30pm UTC
Change assert(x > 0);
to assert(x >= 0);
and your code would be ok.
Sep 28, 2014 at 10:58pm UTC
Holy shit, now I realized that all I program is absolute crap xD
Thanks man. You really helped me with this.