Introduction to Programming using Python 1st Edition

Published by Pearson
ISBN 10: 0132747189
ISBN 13: 978-0-13274-718-9

Chapter 15 - Recursion - Section 15.4 - Problem Solving using Recursion - Check Point - MyProgrammingLab - Page 507: 15.11

Answer

The output of first program will be - 5 4 3 2 1 The output of the second program will be - 1 2 3 4 5

Work Step by Step

In the first program the value is printed first then the recursive call is made on the smaller number hence the value is printed in decreasing order, but in second program the value is printed after recursive call is made so the smaller number are printed first and then the larger numbers are printed.
Update this answer!

You can help us out by revising, improving and updating this answer.

Update this answer

After you claim an answer you’ll have 24 hours to send in a draft. An editor will review the submission and either publish your submission or provide feedback.