Assignment_26 - If you get stuck, search the internet for...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Assignment 26 Functions with one input parameter Write a program which contains a function called countDown . This function takes one integer parameter and displays all of the numbers between that number and one by counting backwards. See the following screen shots. However , the program can not contain any looping; that is, no while , for or do. .while loops, and it certainly can not contain any goto statements. Remember that any function can call any other function, even itself.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: If you get stuck, search the internet for the term recursion . Use the code below as a baseline modify only the countDown function, nothing else. #include <iostream> using namespace std; void countDown( int x) { // WRITE THE FUNCTION CODE IN HERE; // DO NOT ADJUST THE REST OF THE PROGRAM // EXCEPT TO PUT YOUR NAME ETC AT THE TOP } int main() { int num; cout << "Enter a positive number: " ; cin >> num; countDown(num); }...
View Full Document

This note was uploaded on 01/11/2010 for the course CMPSC 101 taught by Professor Drobish,renee during the Summer '07 term at Pennsylvania State University, University Park.

Page1 / 2

Assignment_26 - If you get stuck, search the internet for...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online