Computer Science, asked by kankanapaul12, 2 months ago

please help me in solving this​

Attachments:

Answers

Answered by anindyaadhikari13
4

Required Answer:-

Given C∅de:

int m=2;

int n=15;

for(int i=1;i<=5;i++)

  m++;

System.out.print("m is: "+m);

To Find:

  • The value of m.

Answer:

  • m = 7

Explanation:

  • Initially, m = 2
  • Here, the for-loop iterates 5 times (from i = 1 to 5).
  • After each iteration, value of m is incremented by 1.
  • So, value of m is incremented 5 times.
  • m = 2 + 5 = 7
  • So, the value of m after execution is 7.

Refer to the attachment.

•••♪

Attachments:
Similar questions