#include <stdio.h>
#include <stdlib.h>
#include<conio.h>
void main(){
char *s;
FILE *fw;
clrscr();
fw = fopen("xyz.txt","w");
if( fw == NULL )
{
printf("Error while opening the file.
");
getch();
exit(0);
}
printf("Enter a sentence:
");
gets(s);
fprintf(fw,"%s", s);
fclose(fw);
getch();
}