Contact Learn C
Copy Program Share Program

Program 379: Printing program's own Source Code

Program 379: Printing program's own Source Code
 
#include<stdio.h>
main()
{
   FILE *file;
   char c;
   file = fopen(__FILE__,"r");
   do
   {
     c = getc(file);
     printf("%c",c);
   }while (c != EOF);
   fclose(file);
   printf("\n");
}
Explanation:
 //Coming Soon


Output:
Printing program's own Source Code


No comments:

Post a Comment

Donate

Download App and Learn when ever you want

Get it on PlayStore
Get it on Amazon App Store
Get it on Aptoide