Froggy Jumps C++ Programming QuizVersión en línea Test your knowledge of C++ programming and control structures with these questions! por Lopez del rosal Edwin104 1 What is the purpose of a loop in C++? a To end the program b To repeat a block of code multiple times c To skip certain lines of code 2 What is the syntax for a 'for' loop in C++? a for(initialization; condition; update) b for(condition; update; initialization) c for(update; condition; initialization) 3 What is the 'switch' statement used for in C++? a To declare variables b To perform mathematical calculations c To execute different blocks of code based on the value of an expression 4 What is the purpose of 'if-else' statements in C++? a To print text to the console b To create new functions c To make decisions in the program based on certain conditions 5 What is the role of 'break' statement in a loop in C++? a To print a message to the console b To exit the loop immediately c To continue to the next iteration of the loop 6 What is the purpose of 'do-while' loop in C++? a To execute a block of code only once b To execute a block of code at least once, then repeat as long as a condition is true c To execute a block of code based on a counter 7 What is the syntax for 'if-else if-else' statements in C++? a if(condition1) { } else if(condition2) { } else { } b if(condition1) { } else { } if(condition2) { } c if(condition1) { } else { } else if(condition2) { } 8 What is the purpose of 'continue' statement in a loop in C++? a To skip the rest of the loop and continue with the next iteration b To print a message to the console c To exit the loop immediately 9 What is the role of 'default' case in a 'switch' statement in C++? a To terminate the program b To skip the 'switch' statement c To execute when none of the other cases match the value of the expression 10 What is the syntax for a 'while' loop in C++? a while {condition} { } b while { } (condition) c while(condition) { }