puts C



 puts-c

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 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
  1. Here puts("welcome to wikitechy world (www.wikitechy.com)") specifies the print statement in newline.
  2. Here puts("This is puts() function") specifies the print statement in a newline.

Sample Output - Programming Examples

puts-function-sample-output
  1. Here in this output welcome to wikitechy world (www.wikitechy.com) statement has been printed which is represented in puts() function .
  2. Here in this output This is puts() function statement has been printed which is represented in puts() function in next new line.

View More Quick Examples


Related Searches to c puts function