Illustrating gets and puts functions in C

 #include <stdio.h>
 
 int main()
 {
 
    char s1[80];
    int outcome;
 
    printf("Enter a string : ");
    gets(s1);
    printf("The string is %sn",s1);
    printf("Using puts(): ",s1);
    outcome=puts(s1);
    printf("nThe value returned by puts( ) is %d.n",outcome);
    return 0;
 }

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.