The assignment given to me requests all result after calculation must be "rounded up". So I've thought about using ceil. However in some circumstances, the result wasn't as i expected. Here is an example:
int a; cin>>a; //a=100
double b;
b=ceil(a*1.1);
cout<<b;
The result should be 110. But what i've got was 111. I don't khow why it came out like that and this also happen with numbers whose last digit is 0. Please explain it to me and if there is any way to fix i would be grateful if you could tell me.