How can I pad a string to a known length? Ans. Padding strings to a fixed length can be handy when you are printing fixed-length data such as tables or spreadsheets. You can easily perform this task using the printf() function. The following example program shows how to accomplish this task: #include char *data[25] = { 'REGION', '--Q1--', '--Q2--', '--Q3--', ' --Q4--', 'North', '10090.50', '12200.10', '26653.12', '62634.32', 'South', '21662.37', '95843.23', '23788.23', '48279.28', 'East', '23889.38', '23789.05', '89432.84', '29874.48', 'West', '85933.82', '74373.23', '78457.23', '28799.84' }; void main(void); void main(void) { int x; for (x=0; x - Study24x7
Social learning Network
29 Mar 2023 03:42 PM study24x7 study24x7

How can I pad a string to a known length? Ans. Padding strings to a fixed length can be handy when you are printing fixed-length data such as tables or spreadsheets. You can easily perform this task using the printf() function. The following example program shows how to accompli...

See more

study24x7
Write a comment
Related Questions
500+   more Questions to answer
Most Related Articles