The goal of the program that I have to create is to have the user enter a number. From there, a function will countdown from that number to 0 and then return0;
The only hint that my instructor gave us was to lookup "recursion" on the internet. I am sorta confused about that.
Also, we ARE NOT allowed to use loops.
Here's the base code, I need to edit only the function.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#include <iostream>
usingnamespace std;
void countDown(int x)
{
}
int main()
{
int num;
cout << "Enter a positive number: ";
cin >> num;
countDown(num);
}
Okay, that made sense. I'm able to make my function. This might seem like a stupid question, but I can't stop my program from putting a 0 (the assignment asks to not display the zero and to just show the return 0; screen)
I tried putting in the return 0; function, but my program had an error that said void can't return anything.