How would i round a number with data type of double to the nearest hundred.
the code is for int data types. Is their a way of using this method for doubles. Or any other method.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
int a;
cin >> a;
int round = a % 100;
int m = a - round;
cout << m + 100;
|
Last edited on
Please do not double-post.
http://www.cplusplus.com/forum/beginner/197890/#msg949227
Don't you hate it when they do that ?