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:

[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
Get step-by-step solutions from verified subject matter experts
