Program to print the source code of Program itself as output in C



# include
main()
{
FILE *fp1;
char ch;
fp1=fopen("program.c","r");
while((ch=fgetc(fp1))!=EOF)
printf("%c",ch);
fclose(fp1);
}

No comments:

Post a Comment