#include<stdio.h>
#include<conio.h>
void main()
{char ch;
FILE *vk=fopen("vvv.txt","wb"); //to write"w" in the file
clrscr();
if(vk==NULL) //if file doesnot exit(NULL), exit from program
{
printf("\n\n File does not exit \n");
exit(0);
}
printf("\n\n Enter 0 to exit ");
while(1)
{ch=getche();
if(ch=='0')
break;
fputc(ch,vk);
}
fclose(vk);
getch();
}
Comments
Post a Comment