Let’s say I have a floating point number or an integer number, I want to print it in always 5 characters.
See, if output by the compiler is 21 then it should print 00021,
In case of 123, output should be 00123,
In case of 3.45, output should be 00003.45.
And now at the end, can you also help me to get alternative of zeros here in this case. I’m mean “printf with leading any character including zeros”?
For above case: x(any chaeacter)
1st output should be xxx21,
2nd output should be xx123,
3rd output should be xxxx3.45.
I hope you got the question.