+ 5

[C] How to print a variable in a field of size S? (S is inputted by the user)

Everyone knows, %3d right? % means print a variable 3 means use at least 3 space to display d means the variable will be integer but is there anyway to print with a field of size S, where S in an integer inputted by the user?

17th Jul 2019, 7:04 AM
Md Faridul Islam
Md Faridul Islam - avatar
5 Respuestas
+ 7
Interesting question 👍👍
18th Jul 2019, 3:44 PM
Manoj
Manoj - avatar
+ 3
it worked! thanks a lot 😃
17th Jul 2019, 7:17 AM
Md Faridul Islam
Md Faridul Islam - avatar
0
Int a[5]; gets( a); Printf("%s",a); You can use it
19th Jul 2019, 3:23 AM
Mohammad Ullah
Mohammad Ullah - avatar
0
Good question 😼
24th Jul 2019, 7:27 PM
Youssef Eddaif
Youssef Eddaif - avatar