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.
Chapter8: Advanced Method Concepts
Section: Chapter Questions
Problem 4RQ
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,
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT