Chapter 14: Problem 1
include
/*! This file is auto-generated */ .wp-block-button__link{color:#fff;background-color:#32373c;border-radius:9999px;box-shadow:none;text-decoration:none;padding:calc(.667em + 2px) calc(1.333em + 2px);font-size:1.125em}.wp-block-file__button{background:#32373c;color:#fff;text-decoration:none}
Learning Materials
Features
Discover
Chapter 14: Problem 1
include
All the tools & learning materials you need for study success - in one app.
Get started for free
If your program produces an error message that says stack overflow, what is a likely source of the error?
Write a recursive void function that takes a single int argument \(n\) and writes the integers \(1,2, \ldots, n\)
Write a recursive void function that has one parameter which is a positive integer and that writes out that number of asterisks '*' to the screen all on one line.
Write a recursive void function that takes a single int argument \(n\) and writes integers \(n, n-1, \ldots, 3,2,1 .\) Hint: Notice that you can get from the code for Self-Test Exercise 4 to that for Self-Test Exercise 5 (or vice versa) by an exchange of as little as two lines.
Write a recursive void function that has one parameter, which is a positive integer. When called, the function writes its argument to the screen backward. That is, if the argument is \(1234,\) it outputs the following to the screen: 4321
What do you think about this solution?
We value your feedback to improve our textbook solutions.