Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
417 B
1
Indexable
Never
#include <stdio.h>
#include <stdlib.h>

void main()
{
   FILE *fptr;
char ch[200];

   fptr=fopen("C:\Sudip_Dahal_File_Handling2","w");
   if(fptr==NULL){
    printf("File not opened !!!");
   exit(0);
   }

   else {
    printf("File opened successfully.");
   }

   //fputs("Hello!Sudip_Dahal",fptr);
   fgets(ch,2,fptr);

   printf("\nContent in the file is : %s",ch);
   fclose(fptr);
}

Leave a Comment