What is the final value of variable myNum after the following code fragment executes? int myNum 0; int value - 1; switch (value) case 1: myNum - 10; break; case 2: myNum- 20; break; case 3: myNum 30B break; case 4: myNum -40; break: default: break: 10 20

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter4: Making Decisions
Section: Chapter Questions
Problem 5RQ: What is the output of the following code segment?intc=6,6=12;if(cd);Write(Green);WriteLine(Yellow);...
icon
Related questions
Question
What is the final value of variable myNum after the following code
fragment executes?
int myNum
0;
int value - 1;
switch (value)
case 1:
myNum - 10;
break;
case 2:
myNum- 20;
break;
case 3:
myNum
30B
break;
case 4:
myNum
-40;
break:
default:
break:
10
20
Transcribed Image Text:What is the final value of variable myNum after the following code fragment executes? int myNum 0; int value - 1; switch (value) case 1: myNum - 10; break; case 2: myNum- 20; break; case 3: myNum 30B break; case 4: myNum -40; break: default: break: 10 20
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,