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.
Sure, but if the abs function is already defined in stdlib.h, might as well use it there instead of rewriting the whole thing.
And sure, it's easy enough to do here. In general, though, I think it's good to get in the habit of using libraries rather than writing more code than needed.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Pointer
You are viewing a single comment's thread. Return to all comments →
Sure, but if the abs function is already defined in stdlib.h, might as well use it there instead of rewriting the whole thing.
And sure, it's easy enough to do here. In general, though, I think it's good to get in the habit of using libraries rather than writing more code than needed.