C puts() function

By using puts() function we can print the string data on console.
puts() function is predefined unformatted function which is declared in stdio.h
puts() function required one argument of type constant char* i.e. an address of a string.
When we are working with puts() function from given add upto null content will be printed on console
When we are working with puts() function automatically new line char will printed on console after printing string data.

Syntax:

int puts(const char* str);

Examples:

#include
#include
int main()
{
char str[10]=”K2schools”;
int i;
clrscr();
for(i=0;str[i]!=10;i++)
puts(str+i);
getch();
return 0;
}

Powered by k2schools