I am having problem with floating point numbers. I think something is clashing here.
The output is :
You are using the wrong format specifier in the scanf and doing this will result in UB(Undefined Behaviour).The correct format specifier for a double is %lf while that of a float is %f. So Just change your scanf to
scanf
double
%lf
%f
scanf("%lf",&y);