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.
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- C program to print a string without any quote (singe or double) in the program
- Hello World Program : First program while learning Programming
- C program to detect tokens in a C program
- Program for n-th even number
- Program to compare m^n and n^m
- Write a URL in a C++ program
- How does a C program executes?
- How to compile 32-bit program on 64-bit gcc in C and C++
- Output of C Program | Set 29
- Output of C++ Program | Set 10
- Output of C++ Program | Set 16
- Output of C++ Program | Set 14
- Program to compute Log n
- Output of C++ Program | Set 18
- OpenMP | Hello World program
- Program to check if two strings are same or not
- Program error signals
- Reasons for a C++ program crash
- Splint -- A C program verifier
- Write a C program that won't compile in C++