#include<stdio.h>
#include<string.h>
int main()
{
FILE *anik;
anik = fopen("Das.txt", "a");
char an[20] = "Anik Das";
int i, a = strlen(an);
if(anik == NULL)
{
printf("File Does Not Exist\n");
}
else
{
printf("File Is Exist\n");
for(i=0;i<a;i++)
{
fputc(an[i], anik);
}
printf("File is written successfully\n");
fclose(anik);
}
return 0;
}
#include<string.h>
int main()
{
FILE *anik;
anik = fopen("Das.txt", "a");
char an[20] = "Anik Das";
int i, a = strlen(an);
if(anik == NULL)
{
printf("File Does Not Exist\n");
}
else
{
printf("File Is Exist\n");
for(i=0;i<a;i++)
{
fputc(an[i], anik);
}
printf("File is written successfully\n");
fclose(anik);
}
return 0;
}
Comments
Post a Comment