Extra Credit 1

If you got the error message “loopier: m n d” or a message saying that “1 != 0” from Gradescope, please >download loopier.c again! That has the problem fixed. Also, note the extension until Thursday at 11:59pm.

Due: April 24, 2023
Points: 30


Redo problem 2 of the homework, with each function having a third argument. This argument is to be the increment or decrement. So, for example, if the function do_for is called as do_for(3, 10, 2), then it would print 3, 5, 7, 9, and if it is called as do_for(10, 3, -2), then it would print 10, 8, 6, 4.

Note that do_for(10, 3, 2) or do_for(3, 10, -2) will give an error message (it’s in the wrapper, so you don’t need to add it).

The file loopier.c is available on the class web site. Like loopy.c, it contains three functions with the above interface. The third parameter, d, is the increment. Write each loop in the appropriate function.

Call your file “loopier.c”.


UC Davis sigil
Matt Bishop
Office: 2209 Watershed Sciences
Phone: +1 (530) 752-8060
Email: mabishop@ucdavis.edu
ECS 36A, Programming & Problem Solving
Version of April 12, 2023 at 11:46AM

You can also obtain a PDF version of this.

Valid HTML 4.01 Transitional Built with BBEdit Built on a Macintosh