Can you predict the output?


(Calvin Krusen) #1

Saw this a long time ago…

#include <stdio.h>
char *program = "#include <stdio.h>%cchar *program = %c%s%c;%cint main()%c{%cprintf(program, 10, 34, program, 34, 10, 10, 10, 10, 10, 10);%c    return 0;%c}%c";

int main()
{
        printf(program, 10, 34, program, 34, 10, 10, 10, 10, 10, 10);
        return 0;
}

Can you predict the output?


(Kevin Simon) #2

Object reference not set to an instance of an object.


(Kevin Simon) #3

This is fixed in the next version. You will need to upgrade.


(Jose C Gomez) #4

My c is not what it used to be… LoL but by the looks of it… its a program that prints itself… which is weird.


(Simon Hall) #5

Ten points to Griffendor!

Ran it through https://www.onlinegdb.com/online_c_compiler.

Not even a syntax error. and that is weird…hmmmm Cloning in Digital form.