Let's say I have 43, I want to round it to 50
More examples:
41 would be 50
26 would be 30
21 would be 30
57 would be 60
I know there's a round() function, but I think it rounds up with a smaller number if the original number ends with 5 and less...
My code:
int total = nomber1 + nomber2;
int roundedTotal = 0;
int control;
if (total % 10 == 0) {
control= 0;
} else {
control = roundedTotal - total ;
}
Don't pay too much attention to the calculations. All I need is to know how I can round up total to the greatest number ending with 0.