puts C
![puts-c](https://wikitechy.com/cdn/tutorials/c-programming/puts-c.gif)
Learn C - C tutorial - Puts c - C examples - C programs
C - puts() Function - Definition and Usage
- The puts() function automatically inserts a newline character at the end of each string it displays, so each subsequent string displayed with puts() is on its own line.
- puts() returns non-negative on success, or EOF on failure.
- Uses of Puts() function in C :
- puts() is used to Print Message which is similar to printf statement in C .
- Asks the user for entering the data.
![C Puts Function C Puts Function](https://wikitechy.com/cdn/tutorials/c-programming/c-puts.png)
C Syntax
puts(string_Variable_name) ;
Sample coding - C - Puts Function
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
puts("welcome to wikitechy world(www.wikitechy.com)");
puts("This is puts() function");
getchar();
}
C Code - Explanation
![code-explanation-puts-function code-explanation-puts-function](https://wikitechy.com/cdn/tutorials/c-programming/code-explanation-puts-function.png)
- Here puts("welcome to wikitechy world (www.wikitechy.com)") specifies the print statement in newline.
- Here puts("This is puts() function") specifies the print statement in a newline.
Sample Output - Programming Examples
![puts-function-sample-output puts-function-sample-output](https://wikitechy.com/cdn/tutorials/c-programming/puts-function-sample-output.png)
- Here in this output welcome to wikitechy world (www.wikitechy.com) statement has been printed which is represented in puts() function .
- Here in this output This is puts() function statement has been printed which is represented in puts() function in next new line.