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

Adblocker detected! Please consider reading this notice.

We've detected that you are using AdBlock Plus or some other adblocking software which is preventing the page from fully loading.

We don't have any banner, Flash, animation, obnoxious sound, or popup ad. We do not implement these annoying types of ads!

We need money to operate the site, and almost all of it comes from our online advertising.

Please add to your ad blocking whitelist or disable your adblocking software.