--:--









Quiz for goto statement

Course: C Language | Subject: Unit 3 | Topic: Control Statements



Logo

Q1: Which keyword is used to transfer control to a labeled statement in C?

Logo

Q2: In C, a label used with goto must be followed by which symbol?

Logo

Q3: Can goto transfer control to a label outside the current function?

Logo

Q4: Which of the following is a valid label for goto?

Logo

Q5: What is a common drawback of using goto statements?

Logo

Q6: What happens if the label specified in goto does not exist?

Logo

Q7: Is it possible to use goto to jump into a loop?

Logo

Q8: Which of the following is true about goto?

Logo

Q9: What is the output of: int i=0; start: i++; if(i<3) goto start; printf("%d", i);

Logo

Q10: Which is a safer alternative to goto for breaking multiple loops?

Logo

Q11: Can goto skip variable initialization?

Logo

Q12: When is it acceptable to use goto in C?

Logo

Q13: Can labels and goto have the same name as a variable?

Logo

Q14: What is the main reason to avoid goto?

Logo

Q15: Which keyword is used to define a label in C?

Logo

Q16: Can goto jump into a block that has variables with automatic storage duration?

Logo

Q17: Which of the following uses goto correctly?

Logo

Q18: What does "spaghetti code" refer to in programming?

Logo

Q19: What is the output of: int x=0; label: x+=2; if(x<5) goto label; printf("%d", x);

Logo

Q20: Which section of code is most likely to use goto in system programming?

Are you ready to start test? Set your time limit