RUPAK SEARCH ENGINE

Custom Search

Write a program to append some names in an existing data file.

Write a program to append some names in an existing data file.
#include
#include
#include
#include
void main()
{
FILE *fptr;
char name[10],c;
clrscr();
fptr=fopen("myfile.txt","a");
do
{
printf("Name:");
scanf("%s",name);
fprintf(fptr,name);
fprintf(fptr,",");
printf("Press \"y\" to continue\n");
c=getche();
}while(toupper(c)=='\Y');
fclose(fptr);
}

No comments:

Post a Comment