I got what you meant, but still takes time to give an answer, I dont know now what is the problem but I have one solution to the problem. Thank you.
Code:
#include<iostream>
using namespace std;
#include<cmath>
double roundtohundreths (double);
int main()
{
char t = 'Y';
double x;
while( t != 'N' && t != 'n' )
{
if ( t == 'Y' || t == 'y' )
{
cout << "Enter number: ";
cin >> x;
while( char() != '\n' );
cout << "Original value is: " << x << endl;
cout << "Rounded number is: " << roundtohundreths( x ) << endl;
}
cout << "Type Y for entering a number ( N to end ): ";
cin >> t;
char t += t = 'Y' // im not sure whether to add this to
// give an immediate answer
}
return 0;
}
double roundtohundreths (double a)
{
double roundto = floor( a * 100 + .5 ) / 100;
return roundto;
}