GET EDUCATE

Contents
Basics of C Programming

⯈Basic C Programs

gets function in C

  • gets function is used to read a string from the end user through the keyboard. 
  • This function reads the multi word string.
  • It is unformatted input function.
  • Prototype:
char * gets(char *);
  • It returns char * (character pointer) after it reads a string.
#include<stdio.h>
int main()
{
char str[100];
gets(str);
puts(str);
return 0;
}
output gets
Scroll to Top