Read string and output string by printf - C String

C examples for String:String Console Input

Description

Read string and output string by printf

Demo Code

#include <stdio.h>
int main()//w  w  w  . ja v a  2s . co  m
{
   char kitty[20];
   printf("What would you like to name your cat?");
   gets_s(kitty);
   printf("%s is a nice name. What else do you have in mind ? ", kitty);
   gets_s(kitty);
   printf("%s is nice, too.\n", kitty);
   return(0);
}

Result


Related Tutorials