What's wrong to use operators while you are using floating point numbers. Can't we use '==' '<=' etc operators with floating point numbers?
here is the code.
# include <iostream>
using namespace std;
main(){
float x, y, z;
cout<<"1st integer: ";
cin>>x;
do {
cout<<"2nd integer: ";
cin>>y;
if(y<=0 ){
cout<<"You can't divide by zero"<<endl;
continue;
} else {
break;
}
} while (1);
z = x/y;
cout<<"Result: "<<z;
}
it generate right result as i want to get. But from some where i heard that's not a good logic to use operators with floating point numbers. why?