Puts() can print variables - C String

C examples for String:Display

Introduction

puts() can display a string variable, only on a line by itself.

puts() always adds newline character.

Demo Code

#include <stdio.h>
int main()//from ww w  . j  a  v a2 s .c  om
{
   char friend1[20];
   puts("Name some friend you know:");
   gets_s(friend1);
   puts("Yeah, I think");
   puts(friend1);
   puts("is a friend, too.");
   return(0);
}

Result


Related Tutorials