0
Why is it %5s not %s, what does that 5 mean?
2 Answers
+ 6
Hello, đ
Can you specifying your question correctly!
Use the search bar!
https://www.sololearn.com/post/10362/?ref=app
Please, read our guidelines:
https://www.sololearn.com/discuss/1316935/?ref=app
An useful code for any new user here!;)
https://code.sololearn.com/WvG0MJq2dQ6y/
+ 2
Sunil Shah, I think you're talking of formatted output in C, right?
printf("%s", "word");
means that you insert the string (s) at the spot of the %.
printf("%5s", "word");
says how wide this entry will be within the string (in letters).
Compare:
printf("%s", "x");
leads to the output
x
while printf("%5s", "x")
would look like this:
x <-- 4 spaces from the left