Question Details

No question body available.

Tags

c

Answers (6)

January 8, 2026 Score: 5 Rep: 34,875 Quality: Low Completeness: 40%

You'll need print a newline after each message: printf("Name: scythress\n"); (and with the : corrected to ;). Is there any other way? With puts("Name: scythress"); which adds a newline automatically, but printf() is more flexible.

January 8, 2026 Score: 2 Rep: 36,689 Quality: Low Completeness: 70%

Using printf is indeed a simple and straight-forward way to print strings to the console (you can use \n for a newline). It also support various formatting options.
Alternatively as @EricPostpischil noted (since you don't require any formatting here) - you can use puts - which also adds the newline for you.

This can be done in other ways (e.g. printing the characters one by one using their ascii value), but I can't think of any way that offers some advantage over this simple approach (at least without specific constraints).

January 8, 2026 Score: 1 Rep: 34,875 Quality: Low Completeness: 40%

About the edit of : to ;, it's best on Stackoverflow not to make rolling corrections to the code posted in response to comments (and especially answers). If that was a just a copying typo then the lesson is to copy/paste your code exactly as-is.

January 8, 2026 Score: 1 Rep: 1 Quality: Low Completeness: 0%

Sorry about that, I'm new in stackoverflow and I want to know how this community work

January 8, 2026 Score: 0 Rep: 233,931 Quality: Low Completeness: 30%

puts is the simplest way, and it would have taken care of their absent newline.

January 8, 2026 Score: 0 Rep: 1 Quality: Low Completeness: 0%

Yes \n and do single printf usage if its possible