For some reason, the following code generates an infinite loop, but I can't see why. Also, the output to the screen for values of x gives -1 for all values, which isn't right.
Code:#define a -1 #define b 1 #define NUM 1000 #define dx (b-a)/NUM int main() { float x; x = a; while(x<=b) { // Call a few functions etc printf("%f\n", x); x = x+dx; } }