GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Interview Questions  >  Programming  >  C++

 Print  |  
Question:  How do you write a program which produces its own source code as its output?



June 06, 2006 10:43:10 #2
 Biju Nair   Member Since: Visitor    Total Comments: N/A 

RE: How do you write a program which produces its own ...
 

A program that produces its complete source code as its only output is called a quine.

Eg:

char*f="char*f=%c%s%c;main()
printf(f,34,f,34,10);%c";
main()printf(f,34,f,34,10);

     

 

Back To Question