I am having problem with floating point numbers. I think something is clashing here.
The output is :
Use
scanf("%lf", &y);
instead. Since scanf("%f", &y); works for floats only.
scanf("%f", &y);
float
If you enable compiler warnings it would tell you that the format specifier "%f" expects a float * and not double * argument.
"%f"
float *
double *