C program to write data into a file

Program:

#include<stdio.h>

#include<stdlib.h>

int main()

{

char name[100];

FILE *fp;

fp=fopen("one.txt","a");

printf("Enter the name \n");

gets(name);

fprintf(fp,"%s",name);

return 0;

}

Comments

Popular posts from this blog

C program to print the following Pattern

c++ program to print string along the diagonals of the matrix.

Kollywood Game