Function puts () in C
The function int puts (const char * str) in the standard C library writes a str string to stdout (not writing null characters). A newline character (new line) is appended to the output.
The function int puts (const char * str) in the standard C library writes a str string to stdout (not writing null characters). A newline character (new line) is appended to the output.
Declaring the function puts () in C
Here is the declaration for function puts () in C:
int puts ( const char * str )
Parameters
str - This is the string to be written.
Returns the value
If successful, this function returns a non-negative value. If there is an error, the function returns EOF.
For example
Program C then illustrates the usage of functions puts () in C:
#include #include int main () { char str1 [ 15 ]; char str2 [ 15 ]; strcpy ( str1 , "QTMteam" ); strcpy ( str2 , "xinchaocacban" ); puts ( str1 ); puts ( str2 ); return ( 0 ); }
Compile and run the above C program to see the results.
According to Tutorialspoint
Previous lesson: putchar () function in C
Next lesson: Function ungetc () in C
5 ★ | 2 Vote
You should read it
Maybe you are interested
How to turn a photo into a painting using the Generative Fill function in Photoshop
How to use the TREND function in Excel
Google Sheets Functions to Simplify Your Budget Spreadsheets
Instructions for using the TRIMRANGE function to clean up Excel tables
How to master numerical data in Google Sheets with the AVERAGE function
Don't buy headphones if they lack this important function!