#include<stdio.h>
int main()
{
FILE *fptr;
char chr;
fptr = fopen(__FILE__,”r”);
do{
chr= getc(fptr);
putchar(chr);
}
while(chr!=EOF);
fclose(fptr);
return 0;
}
Output:
$ ./a.exe
#include<stdio.h>
int main()
{
FILE *fptr;
char chr;
fptr = fopen(__FILE__,”r”);
do{
chr= getc(fptr);
putchar(chr);
}
while(chr!=EOF);
fclose(fptr);
return 0;
}