float x, y, ymin, xmin;
This line leave all variables unititalised so they have random (incorrect) values
After 10 iterations of the for loop , the value of y goes on decreasing & it finally triggers the below code to reset values of x,y with thier prev min values.
if(y<ymin){
y=ymin;
x=xmin; //----> so x is initialised to random value ,a predefined min value of x is required
}
Initialisaing the correct values should get the code going .
Also add these headers
#include <stdio.h>
#include <math.h>