C puts()

Sriparno08's avatar
Published Oct 28, 2022Updated May 29, 2025
Contribute to Docs

The puts(), or “put string”, function prints a string to stdout, normally the console, followed by a newline character.

  • Looking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!
    • Includes 6 Courses
    • With Professional Certification
    • Beginner Friendly.
      75 hours

Syntax

puts(str)

The puts() function takes a str argument and prints it, adding a newline character at the end of it.

Example

#include <stdio.h>
int main(void) {
puts("Hello World!");
return 0;
}

The output would be:

Hello World!

All contributors

Contribute to Docs

Learn C on Codecademy

  • Looking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!
    • Includes 6 Courses
    • With Professional Certification
    • Beginner Friendly.
      75 hours