C Programming Code Examples C > File Operations Code Examples Program to Display its own Source Code as Output Program to Display its own Source Code as Output The output of this program is the location of this C programming file. #include <stdio.h> int main() { FILE *fp; char c; fp = fopen(__FILE__,"r"); do { c = getc(fp); putchar(c); } while(c != EOF); fclose(fp); return 0; }