Post #2731618
2026-05-21 05:47 UTC
You need another goto end right before the end_false_if:, otherwise the false code will always run
Replies (1)
-
@testaccount789@sh.itjust.works 2026-05-21 11:15
I tested it, it works as it is. #include #include void main(){ bool true_or_false = true; if(true_or_false){ goto if_true; } printf("This code runs only if false.\n"); goto end_false_if; if_true: printf("This code runs only if true.\n"); end_false_if: printf("This code always runs.\n"); } If true, it jumps to if_true, then runs other code. If false, the if gets skipped, if false code gets run, then it skips over if true code.