How to get the output as (0100) and entering input as 100 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to get the output as (0100) and entering input as 100

18th Nov 2020, 2:04 PM
Vatsav
4 Answers
+ 7
Do "%Nd" where N is the total length of the number you want to print (including the zeros) For example: printf("%03d", 6); --> 006 printf("%05d", 17); --> 00017
18th Nov 2020, 2:37 PM
Davide
Davide - avatar
+ 2
In Which language can u elaborate more https://www.sololearn.com/discuss/333866/?ref=app
18th Nov 2020, 2:08 PM
Shino
Shino - avatar
+ 2
NotAPythonNinja yes that's right. But I think the OP wanted to know about padding zeros.
18th Nov 2020, 2:49 PM
Davide
Davide - avatar
0
Sorry I didn't post the required language I required it in c
18th Nov 2020, 2:19 PM
Vatsav