writing in a text file using c program

 #include <stdio.h>


int main(){
FILE * fptr;
char c;
fptr=fopen("fputcsample.txt","w");

fputc('A',fptr);
fputc('N',fptr);
fputc('C',fptr);
fputc('H',fptr);
fputc('A',fptr);
fputc('L',fptr);
fclose(fptr);
 return 0;
 

Comments