I came across a program that prints itself on this site, i.e. it prints the program code.
The program code is:
#include
char *program
This can be done using File handling. Save the program with any name and put that name in the open directory in fopen command. Like my program's name is hello.cpp.
This is the following program
#include
#include
int main()
{
FILE *fp;
fp=fopen("hello.cpp","r");
char ch;
while((ch=fgetc(fp))!=EOF)
{
printf("%c",ch);
}
}