Computer Science, asked by patelarchee2006, 5 months ago

What is the final value of ctr when the iteration process given below executes?
int ctr=0;
for(int i=1;i<=5;i++)
for(int j=1;j<=5;j+=2)
++ctr;​

Answers

Answered by hitkar585
9

Explanation:

the value of ctr is 15

this is the correct answer

Answered by reneeparakh2204
3

Answer:

The final value of ctr is 15.

Explanation:

The outer loop executes 5 times. For each iteration of outer loop, the inner loop executes 3 times. So, the statement ++ctr; is executed a total of 5 x 3 = 15 times.

Similar questions