Podcast
Questions and Answers
What is the purpose of control structures in programming?
What is the purpose of control structures in programming?
- To alter the flow of program execution based on specified conditions (correct)
- To store and retrieve data efficiently
- To minimize the size of the program
- To beautify the code for better readability
Which control structure is used to execute a block of code only if a certain condition is true?
Which control structure is used to execute a block of code only if a certain condition is true?
- while loop
- if statement (correct)
- for loop
- switch statement
What does the 'else' keyword do in control structures?
What does the 'else' keyword do in control structures?
- It provides an alternative path of execution when the 'if' condition is false (correct)
- It terminates the program immediately
- It restarts the program from the beginning
- It has no specific function in control structures