Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to add a space after each number of output to separate them

In this loop I print each of the values in an array "values." They appear as 93832734557896 instead of 9383 2734 557 896, etc:

for( n = 0 ; n < num_values; n++ ) {
    printf("%llu", values[n]); }

I want to print a space after each number, not a newline. How can I do that with printf?

Thanks

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Just add a space in your printf statement:

printf("%llu ", values[n]);
//          ^ notice the space here
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading