We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
suppose your total value is a float datatype the it retains only the integer value thereby elemnating the decimal value.
this in turn is used to check if the decimal part is less than or greater than 0.5.
if its greater than 0.5 it adds a number to inttotaland thereby you round the value to nearest integer.
hope my answer helped you.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Day 2: Operators
You are viewing a single comment's thread. Return to all comments →
suppose your total value is a float datatype the it retains only the integer value thereby elemnating the decimal value. this in turn is used to check if the decimal part is less than or greater than 0.5. if its greater than 0.5 it adds a number to inttotaland thereby you round the value to nearest integer. hope my answer helped you.