Do you think the output of this code alright???
Code:#include<iostream.h>
#include<math.h>
inline double round(double X, int k)
{
return ( floor( X*pow10(k) + 0.5) / pow10(k) );
}
int main()
{
double x;
while(cin >> x)
cout << " Round of " << x << " is : " << round(x,2) << endl;
return 0;
}
Quote:
9.005
Round of 9.005 is : 9.01