Would it be possible to print Hello twice using single condition?
if \"condition\"
printf (\"Hello\");
else
printf(\"World\");
Buckle your seatbelts:
#include
#include
int main()
{
jmp_buf env;
if (!setjmp(env))
{
printf("if executed\n");
longjmp(env, 1);
}
else
{
printf("else executed\n");
}
return 0;
}
Prints:
if executed
else executed
Is this what you mean? I doubt it, but at least it's possible. Using fork you can do it also, but the branches will run in different processes.