#include < stdio.h>
int main()
{
FILE *fp;
char ch;
fp = fopen(__FILE__,"r");
do
{
ch = getc(fp);
putchar(ch);
}
while (ch != EOF);
fclose(fp);
return 0;
}
Output
/*
* display its own source code as its output
*/
#include
int main ( )
{
FILE * fp;
char ch;
fp = fopen ( __FILE__,"r" ) ;
do
{
ch = getc ( fp ) ;
putchar ( ch ) ;
}
while ( ch ! = EOF ) ;
fclose ( fp ) ;
return 0 ;
}
For More Details Please Visit Ictjobs.info
No comments:
Post a Comment