A quine is a program which prints a copy of its own as the only output. A quine takes no input. Quines are named after the American mathematician and logician Willard Van Orman Quine (1908–2000). The interesting thing is you are not allowed to use open and then print file of the program.
To the best of our knowledge, below is the shortest quine in C.
This program uses the printf function without including its corresponding header (#include
Following is a shorter version of the above program suggested by Narendra.
If you find a shorter C quine or you want to share quine in other programming languages, then please do write in the comment section.
- Complicated declarations in C
- Optimization Techniques | Set 2 (swapping)
- Use of bool in C
- What are the operators that can be and cannot be overloaded in C++?
- Multithreading in C
- Program to Find the Largest Number using Ternary Operator
- Passing Reference to a Pointer in C++
- How to avoid Structure Padding in C?
- wcrtomb() function in C/C++
- vswprintf() function in C/C++