Question
QUESTION 2 What is the output for total after the following segment of code executes? int num = 3, total = 0; switch (num) {
QUESTION 2
What is the output for total after the following segment of code executes? int num = 3, total = 0; switch (num) { case 1: case 2: total = 5; break; case 3: total = 10; break; case 4: total = total + 3; break; case 8: total = total + 6; break; default: total = total + 4; break; } WriteLine("The value of total is " + total); The value displayed for total would be . If num had been initialized to 100, would be displayed. If num was initialized to 1, would be displayed.
QUESTION 3
Assuming the following declarations: int a is 5, b is 6, c is 8; which of the result of each of the expressions. Identify the result of each of the expressions. a. a == 5;_________________ b. 7 <= (a + 2); ___________ c. c <= 4;____________ d. (1 + a) != b; ____________ e. a >= 0; ___________ f. a <= (b * 2); ____________
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started