1. What is the purpose of the 'if' statement in C#? A. To execute a block of code repeatedly B. To handle exceptions C. To execute a block of code if a condition is true D. To define a method Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
2. Which control flow statement is used to iterate over a collection in C#? A. for B. foreach C. do-while D. None of the above Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option B No explanation is given for this question Let's Discuss on Board
3. What is the result of the expression 5 > 3 ? "Yes" : "No" in C#? A. 5 > 3 ? Yes : No B. 5 > 3 ? "Yes" : "No" C. Yes D. No Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
4. What does the 'break' statement do in a loop in C#? A. Skips to the next iteration B. Continues to the next loop iteration C. Initializes the loop D. Terminates the loop Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D No explanation is given for this question Let's Discuss on Board
5. Which control flow statement is used to handle exceptions in C#? A. try-catch B. if-else C. switch-case D. for Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board
6. What is the purpose of the 'switch' statement in C#? A. To define a method B. To handle exceptions C. To iterate over a collection D. To execute different blocks of code based on the value of an expression Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D No explanation is given for this question Let's Discuss on Board
7. In C#, what is the syntax for a 'for' loop? A. while (condition) { } B. foreach (element in collection) { } C. for (initialization; condition; update) { } D. do { } while (condition); Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
8. Which keyword is used to skip the current iteration of a loop in C#? A. skip B. continue C. next D. None of the above Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option B No explanation is given for this question Let's Discuss on Board
9. What is the result of the expression 10 % 2 == 0 ? "Even" : "Odd" in C#? A. 10 % 2 == 0 ? "Even" : "Odd" B. 10 % 2 == 0 ? Even : Odd C. Even D. Odd Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
10. Which control flow statement is used to define a block of code that executes repeatedly as long as a condition is true in C#? A. for B. do-while C. switch D. while Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D No explanation is given for this question Let's Discuss on Board