Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How to write a program which prints its own source code as output?

0
Posted

How to write a program which prints its own source code as output?

0

A Program which reproduces its own source code is called as a quine. There are lots of ways to do this, here are some of them: • main(){char *c=”main(){char *c=%c%s%c;printf(c,34,c,34);}”;printf(c,34,c,34);} • main(){char*a=”main(){char*a=%c%s%c;int b=’%c’;printf(a,b,a,b,b);}”;int b='”‘;printf(a,b,a,b,b);} You can find more such codes on the web if you search for quine, Here is an article written by Gary P.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123