Question: Write a double loop over 0 i,j N, where N is a number your read in. A good test case is N = 40. Can

Write a double loop over 0 i,j N, where N is a number your read in. A good test case is N = 40.

Can you traverse the i,j indices such that they first enumerate all pairs i + j = 1, then i + j = 2, then i + j = 3 et cetera?

Write a program that prints out both pairs, each on a separate line, with the numbers separated with a comma, for instance 8,5.

The output should look like this:

Write a double loop over 0 i,j N, where N is a

[ajpye@isp02 Exercises]$ . /Exercise4 Enter upper bound: 40 [ajpye@isp02 Exercises]$ . /Exercise4 Enter upper bound: 80 9,9 9,9 [ajpye@isp02 Exercises]$ . /Exercise4 Enter upper bound: 20 3,7 3,7

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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

Students Have Also Explored These Related Databases Questions!