GeeksforGeeks » Interview Questions

c programs

(5 posts)

Tags:

  1. Ritesh
    guest
    Posted 5 months ago #

    Write a program which prints itself.

  2. Ritesh
    guest
    Posted 5 months ago #

    #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;
    
    }
  3. Ritesh
    guest
    Posted 5 months ago #

    ie it da write code or any1 has sum other solution

  4. pavan
    guest
    Posted 4 months ago #

    copy the file to stdout

  5. kartik
    Moderator
    Posted 4 months ago #

    I think the question is about Quine. http://www.geeksforgeeks.org/archives/6902


Reply

You must log in to post.

RSS feed for this topic