example for c label goto:
What will be the output of this below program?
printf("I am at home\n");
VIRUS: goto HOME;
It prints welcome infinite times, and crashes.
it prints welcome, i am at home for infinite times, and crashes
it won't print any thing and it crashes
welcome, i am at home.
This prints welcome infinite times, and crashes. This is one dangerous scenario where we are switching between two lables, and there is no termination condition to come out. First execution starts at HOME, from there after priting "welcome" it jumps to label VIRUS: from there again control jumps to HOME.
Back To Top