C Program Of Fgets() and Fputs()

C Program Of Fgets() and Fputs()

#include<stdio.h>

main()
{

FILE *fp;
char str[100];
char st[5];

fp=fopen("delu.txt","w");

printf("Enter string:\n");
scanf("%s",str);

fputs(str,fp);

fclose(fp);

fp=fopen("delu.txt","r");


fgets(st,50,fp);

printf("%s\n",st);

fclose(fp);

}

Related Posts