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 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?

Step by Step Solution

3.44 Rating (157 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

a 10 2 10 90 ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Document Format (1 attachment)

Word file Icon

954-M-L-A-L-S (7323).docx

120 KBs Word File

Students Have Also Explored These Related Linear Algebra Questions!