0

What is the meaning of %5d in C language?

printf("%5d", a);

20th Oct 2018, 3:50 AM
yasifa ana
4 ответов
+ 1
i'm sorry, its define how much space are needed for the output. if the character/digit less than what we define (in this case is 5) then the ouput will add left padding with space until it reach the number that define before. mostly its used for better formatting like create a table in console, so each row has same width.
20th Oct 2018, 4:53 AM
Taste
Taste - avatar
0
its length so that one is 5 digits
20th Oct 2018, 4:29 AM
Taste
Taste - avatar
0
ooh, i get it,, thank you so much Taste
20th Oct 2018, 4:58 AM
yasifa ana
- 2
what? I dont get it, sorry hahah can you explain to me again please? Taste
20th Oct 2018, 4:37 AM
yasifa ana