GeeksforGeeks » Interview Questions
c programs
(5 posts)-
Write a program which prints itself.
-
#include <cstdio> int main(int argc, char *argv[]) { FILE * pFile; int c; pFile=fopen ("quine.cpp","r"); if (pFile==NULL) perror ("Error opening file"); else { do { c = getc (pFile); printf("%c",c); } while (c != EOF); fclose (pFile); } return 0; } -
ie it da write code or any1 has sum other solution
-
copy the file to stdout
-
I think the question is about Quine. http://www.geeksforgeeks.org/archives/6902
Reply
You must log in to post.