Need help with Compilation error (Works fine with Dev C++)

Can someone kindly help me find the error ? The code is running fine in Dev C++.

prog.c: In function �main�: prog.c:8:25: error: expected �)� before �x� if((x%5==0)&&(float(x)<=y-0.50)) ^ prog.c:8:27: error: expected �)� before �<=� token if((x%5==0)&&(float(x)<=y-0.50)) ^

Thanks

I’m not a C guru, but fix is to replace

float(x)<=y-0.50

with

(float)x<=y-0.50

but I think you do not need to cast it to float :wink:

2 Likes

Thanks :slight_smile:
Works like a charm

1 Like

glad to hear that :wink: you can try ideone next time, I tried - http://ideone.com/yZcqmo

1 Like

Thanks a ton :slight_smile: