Skip to content

Instantly share code, notes, and snippets.

@kakarot-dev
Last active December 5, 2022 11:46
Show Gist options
  • Save kakarot-dev/9ec561bfb492235d53d201c9ea72f6e3 to your computer and use it in GitHub Desktop.
Save kakarot-dev/9ec561bfb492235d53d201c9ea72f6e3 to your computer and use it in GitHub Desktop.
Answers for CS-1 Q1
{
"A": {
"1": "c",
"2": "c",
"3": "a",
"4": "b"
},
"B": {
"1": [
"While loop: It checks the condition, and only then can we execute the statement(s).",
"We always need to initialize a variable in a condition before the execution of this loop.",
"DO..While loop: The execution of statement(s) occurs at least once. After that, the checking of the condition occurs.",
"The initialization of the variable may occur within or before the execution of the loop"
],
"2": [
"Yes, It is possible to have nesting of loops in C++",
"A nested loop means a loop statement inside another loop statement. Hence you can use all of the loops inside themselves"
],
"3": [
"You can use the break statement to end processing of a particular condition within the switch statement. ",
"It branches to the end of the switch statement. ",
"Without break, the program continues to the next condition, executing the statements until a break or the end of the statement is reached."
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment