adspace
How do you write a program which produces its own source
code as its output?
Answer Posted / ram
#include <stdio.h>
main()
{
FILE *fd;
int c;
fd= fopen("./file.c","r");
while ( (c=fgetc(fd)) != EOF)
{
printf("%c", c);
}
fclose(fd);
}
| Is This Answer Correct ? | 19 Yes | 8 No |
Post New Answer View All Answers