File Operations in Tamil


Learn C - C tutorial - Fgets in c - C examples - C programs

C - fgets() - Definition and Usage

  • In C – Programming, the fgets function is used to get the input string.
C fgets

C Syntax

char *fgets(char *str, int size, file* file);

Sample - C Code

#include <stdio.h>
#include <stdio.h>
void main()
    char a[10];
    printf("Enter Your Content : \n");
    printf("Wikitechy is a  %s\n",a);

C Code - Explanation :

  1. In this statement we create the character array with its variable name as “a”.
  2. Here in this statement we get the file input string using “fgets” function.
  3. Here in this printf statement we print the output content.

Sample Output - Programming Examples

  1. Here in this output we get the input text “Technical Forum” using fgets function as shown here.
  2. So the final output string will be displayed using printf function as “Wikitechy is a Technical Forum”

View More Quick Examples

Related Searches to C fgets