C Challenge: Self-Printing Program
Source: <a href="https://www.cprogramming.com/challenges/self_print.html" target="_blank" rel="noopener noreferrer">Programming Challenges - Self-Printing Program - Cprogramming.com</a>
Here's a nice challenge for all you programming freaks.
Write a program that, when run, will print out its source code. This source code, in turn, should compile and print out itself.
Discuss the code with fellow CEans in this thread. Googling is good, but it doesn't add value to your knowledge.