logo
Course thumb

The C programming language made simple

The puts function in C

#include <stdio.h> #include <stdlib.h> #include <string.h> int main(int argc, char* argv[]) { char str[] = "hello world"; int res = puts(str); if (res >= 0) { printf("Success\n"); } else { printf("Failure\n"); } return 0; }