42 school subject.
Create quine programs in C as an introduction to the concept of virus propagation in cybersecurity.
A quine is a program that outputs its own content.
An empty program or program that opens and reads its file is prohibited.
A quine program in c that outputs itself in the console.
%c
displays char and %s
displays a string.
In printf 10 is ASCII code for \n
and 34 for "
.
Between %
and c
or s
, 1$
refers to 10 and 2$
TO 34 and $3
to str.
Basically a string representing the program is printed which is also able to print itself by using a self referential embedded format tag.
Outputs its content in another file.
The program creates a new file, writes its own content into that file and executes the file, leading to the creation of another file who also created another file and so on, leading to a self-replicating program which is useful for viruses to propagate.
Self-replicating Python code | Quine
what does print(s%%s) mean here?
Imprimer le code source du code C sans aucune entrée | Quiné