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.
if i want to add 1 in place of zero ,to make three digit number then what will be solution
is there no solution for this quesion
you can calculate the length of integer and then add 100 for two digit integer of add 110 to a single digit integer
can we use %03d in other languages .if yes then please can you name them?
Check out C - it also has printf