In the following program segment i, j, m, and n are integer variables. The values of m

Question:

In the following program segment i, j, m, and n are integer variables. The values of m and n are supplied by the user earlier in the execution of the total program.
for i : = 1 to m do
for j : = 1 to n do
if i ≠ j then
print i + j
How many times is the print statement in the segment executed when
(a) m = 10, n = 10;
(b) m = 20, n = 20;
(c) m = 10, n = 20;
(d) m = 20, n = 10?
Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Question Posted: