Frage im Vorstellungsgespräch bei HMH Education

How to write a function for rounding up a decimal number without using inbuilt function?

Antwort im Vorstellungsgespräch

Anonym

20. Aug. 2024

just take the (int) of given number and substract original number from it then check if the substraction is greater than 0.5 return (int) original + 1 else -1