Â
#include <stdio.h>
#define SIZE 50
void main()
{
FILE *fptr;
char s1[SIZE], s2[SIZE];
printf("Enter any string: ");
gets(s1);
fptr = fopen("sample.txt", "w");
fputs(s1, fptr);
fclose(fptr);
fptr = fopen("sample.txt", "r");
fgets(s2, SIZE, fptr);
printf("You entered: ");
puts(s2);
}
//.....coded by ANANYA MAURYA
#ENJOY CODING
Post a Comment
FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP