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.
They have asked for only numbers between 0 and 999 here so the %03d padding is enough here.
If you need more digits in your number, then you give padding as necessary; in your case, %07d.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Java Output Formatting
You are viewing a single comment's thread. Return to all comments →
They have asked for only numbers between 0 and 999 here so the %03d padding is enough here. If you need more digits in your number, then you give padding as necessary; in your case, %07d.