putchar()

The putchar(), or “put character”, function prints a single character to stdout (normally the console).

Syntax

putchar(char)

The putchar() takes a single char as an argument and prints it.

Example

#include <stdio.h>
int main(void) {
putchar('a');
return 0;
}

The output would be:

a

Contributors

Interested in helping build Docs? Read the Contribution Guide or share your thoughts in this feedback form.

Learn C on Codecademy

Contributors