Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6556385
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:56:17+00:00 2026-05-25T12:56:17+00:00

im simple asking if this is ok. i was asked to do the following.

  • 0

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

this is my code….

#include<iostream>
#include<cstdlib>

using namespace std;

int reverseNum(int num){
    for(int j=num; j>0; j--)
        cout<<j<<" ";
        cout<<endl;
    return false;
}

int main(){
    double enternum = 0;

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

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

    return 0;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T12:56:18+00:00Added an answer on May 25, 2026 at 12:56 pm

    because of this: return false; – I’ll leave it to you to figure out the rest..

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ok, This seem so simple that I feel kind of dumb for asking, yet
I have been asked to write a (very) simple program for a set of
Firstly, I've asked this question elsewhere , but meta.stackoverflow.com seems to think that asking
So I wrote this simple console app to aid in my question asking. What
This is a very simple question and I feel stupid for asking it, but
I'm asking this based on a blog I read... backbone.js simple inheritance... Where does
Before answering this question, understand that I am not asking how to create my
I feel kind of silly asking this question as it seems really simple, but
I'm 10000000% sure that this question has been asked before, however, the majority of
I feel a little silly asking this, because its probably realy simple. Select DISTINCT

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.