puts()

Anonymous contributor's avatar
Anonymous contributor
Published Oct 28, 2022
Contribute to Docs

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

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