India's Largest Free Online Education Platform

C program for implementation of gets and puts function

C program for implementation of gets and puts function

// Our program will asks for name of user and prints it on the screen

#include <stdio.h>   // header files
#include <stdlib.h>
# include<conio.h>
# include<string.h>

int main()    // main function
{
 char name[10]; int i,n;  // variable declaration
 puts("Enter Your name");  // as like as printf command
 gets(name);  // taking input as characters in array "name"

 puts("Name entered by you is :\n");
 puts(name);   // prints whatever is stored in array "name" 

return 0;  // this function returns zero means nothing
}  // end of main function

RESULT:

Output:

C program for implementation of gets and puts function
C program for implementation of gets and puts function

The above code can’t be directly copy-pasted. You must have to type with your own hand. This is made for your better future. 

Are you made for copy paste?

Absolutely “NO”

Then, try hard to understand this code and type with your own.

Leave a Reply

Your email address will not be published. Required fields are marked *

error: Content is protected !!