Question:C program to write to a file 

Answer 
#include<stdio.h>
int main(){
FILE *fp;
char ch;
fp=fopen("file.txt","w");
printf("\nEnter data to be stored in to the file:");
while((ch=getchar())!=EOF)
putc(ch,fp);
fclose(fp);
return 0;
}
 

+ ExplanationNot Moderated
+ Report
Total Preview: 478
C program to write to a file
Copyright © 2024. Powered by Intellect Software Ltd