1. What will be the output of the following code snippet?
int m=10;
int n=20;
for(int i=1;i<=4;i++)
m++;
n--;
System.out.println(n);
System.out.println( m);
Answers
Answered by
1
Answer:
16
14
Explanation:
each time loop executes its wil increase value of m and decrease value of n
so m = 14
n = 16
Answered by
1
Answer:
since curly brackets are not used so only m++ statement will execute with loop
and when the loop terminates
other statements will execute
output
19
14
n=19,m=14(it is not written only just to explain the answer
Explanation:
hope it helps
plz mark me as BRAINLIEST
Similar questions