(d) What will be the output when (i) n=1 (ii)n=2
int x=3;
switch(n)
case 1: ++x;
System.out.println(x);
break;
case 2: X--
System.out.println(x);
Answers
Answered by
0
Answer:
yr answer is 4
x will first increment then don't decrement it in x-- as it is post increment
Similar questions
Math,
4 days ago
English,
4 days ago
Social Sciences,
4 days ago
Physics,
9 days ago
Science,
9 days ago
Social Sciences,
8 months ago
English,
8 months ago