print number in reverse
<p>im simple asking if this is ok. i was asked to do the following. Write a program that will continuously ask the user for positive integers (until the
user enters a negative integer at which the program will be terminated). Every
time the user inputs a positive integer the program will print out this integer in
reverse. Your program should have a function that accepts and integer and returns
an integer in reverse. To convert the integer to its reverse, your program will call
this function. at the end of each output i keep getting 0. please explain why. also if i use void main with the function i get garbage. please explain why. thanks in advance</p>

<p>this is my code....</p>

<pre><code>#include&lt;iostream&gt;
#include&lt;cstdlib&gt;

using namespace std;

int reverseNum(int num){
    for(int j=num; j&gt;0; j--)
        cout&lt;&lt;j&lt;&lt;" ";
        cout&lt;&lt;endl;
    return false;
}

int main(){
    double enternum = 0;

    do{
        cout&lt;&lt;"Enter a positive number &gt; 0, to begin countdown ";
        cin &gt;&gt;enternum; 
        cout&lt;&lt;reverseNum(enternum);
        cout&lt;&lt;endl;
    }
    while(enternum&gt;0);

    if(enternum&lt;=0)
        cout&lt;&lt;"Invalid entry, good bye.";
    cout&lt;&lt;endl;

    return 0;
}
</code></pre>
