Some more information. Here is my output:
----------------------------------
x f(x) sign change
----------------------------------
-1.00 15.9000
-0.75 14.6656
-0.50 13.0250
-0.25 11.0719
0.00 8.9000
0.25 6.6031
0.50 4.2750
0.75 2.0094 ...
User Profile
Collapse
-
Infinite loop problem in Newton-Raphson program
I wrote this program to calculate f(x) and I'm running into a problem that is causing an infinite loop. The output is fine until the first time that the if-loop catches f_x <= 0.0. I've been looking endlessly for what might be causing it to no avail. Maybe fresher eyes can help. Anyone?
Code:#include <stdio.h> #include <math.h> double func1(double x); double func1_d(double x); double
-
gets(), reverse(), and strlen() help
Hi, thanks in advance for the assistance.
I need to make a program that will take a string using gets() (I know gets() is bad, but it's what I'm supposed to use), and then print the message in reverse. One problem I had was that when I used gets(message);, the program just continued without letting me enter anything. I'm using while(strlen(ge ts(message)) == 0); right now and it seems to work, but I'd prefer to use gets(message);...
No activity results to display
Show More
Leave a comment: