Java Output Formatting

  • + 3 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.