1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
asambeis [7]
3 years ago
14

Write a function, reverseDigit, that takes an integer as a parameter and returns the number with its digits reversed. For exampl

e: the value of reverseDigit(12345) is 54321; the value of reverseDigit(5600) is 65; the value of reverseDigit(7008) is 8007; and the value of reverseDigit(–532) is –235
Computers and Technology
1 answer:
Sedbober [7]3 years ago
5 0

Answer:

This program is written in C++. You can implement this program in any language. The code along with comments is given below in explanation section.

Explanation:

#include <iostream>  

using namespace std;  

int main()  // main function

{  

int number, reverseNumber=0, reminder;  //varible declaration  

cout<<"Enter a number: ";  //prompt user to enter the number  

cin>>number;   //save the entered number into number variable  

 while(number!=0)    //while number does not become zero.... remain in loop

 {    

    reminder=number%10;    // taken reminder of number    

    reverseNumber=reverseNumber*10+reminder;   //store the number digit into reverse order  

    number/=10; //decrease the number or shift the division to next digit    

 }    

cout<<"Reversed Number: "<<reverseNumber<<endl;    //print reversed number.  

return 0;  

}  

You might be interested in
You are finally at the stage of the software life cycle where you begin programming. What is this stage called?
nataly862011 [7]
You are finally at the stage of the software life cycle where you begin programming. What is this stage called?

development

5 0
3 years ago
The ease of travel in the twentieth century played a role in the advancement of medicine. Based on this lesson, which statement
Shtirlitz [24]
During the twentieth century, transportation had been very significant and played a great influence in the advancement of medicine. This is because this made health care become more accessible to patients no matter where they are located. The answer for this would be option C.
8 0
3 years ago
Read 2 more answers
Best motherboard cpu and ram combo thats cheap but good for gaming under 200
Leviafan [203]

Kinda hard for under 200

7 0
3 years ago
Points on how will successfully submit quizzes in ICT correctly?
jeka94

Answer:

I am sorry but I don't understand your question. Can you edit it and explain it more briefly?

Explanation:

6 0
4 years ago
Drive.
barxatty [35]

Answer:

22

Explanation:

5 0
2 years ago
Other questions:
  • Please help!
    6·2 answers
  • To keep your audience interested in your speech, you should provide them with as many details as possible about the topic.
    12·1 answer
  • A client-server relationship is the basic form of a ____?
    15·1 answer
  • Instructions
    12·1 answer
  • _____ is a form of witty, amusing speech that is often used to bring people together.
    7·2 answers
  • What is an XML-based open standard for exchanging authentication and authorization information and is commonly used for web appl
    12·1 answer
  • In general, the farther you are from other road users, the A. lower your crash risk B.higher your crash risk C. slower they are
    6·1 answer
  • You work for a company that builds custom PCs for select clients. You are training a new employee to evaluate and select appropr
    13·1 answer
  • My speaker on my phone is not working, when I try and play music and videos the sound dosen't work. However my alarm works. Can
    9·2 answers
  • Java code?????
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!