Write a c program to “Welcome to Nepal” in a file.

Programming Using File Handling:


#include<stdio.h>
#include<conio.h>
 void main(){
FILE *fp;
fp=fopen("C:\\nepal.dat","w");
fprintf("fp,"%s", "Welcome to Nepal");
fclose(fp);
getch();
}

output :

Welcome to Nepal

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *