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
What are the chief contributions of philosophy to artificial intelligence?
olga nikolaevna [1]

Answer

Hi,

The chief contribution of philosophy to artificial intelligence is the knowledge of the connections between the two and the understanding of the shared concept.

Explanation

Philosophy and Artificial intelligence has a close scientific connection because they both share concepts such as action, consciousness, epistemology and free will. From the artificial intelligence perspective, theories in philosophy are important in AI as long as they provide the basis of the designs, reasons and plan. The concepts shared in AI con tribute to the realization of the philosophy of artificial intelligence.

Hope this Helps!

5 0
3 years ago
How to write greater than or equal to in excel if function
natali 33 [55]

Answer:>=

Explanation:3>=4

I

5 0
3 years ago
E lvl:
Alexxandr [17]
I’m cool here here here pizza
5 0
3 years ago
Is a program that copies itself repeatedly, for example in memory or on a network, using up resources and possibly shutting down
alexandr402 [8]
It won't exactly shut down the network but it is usually a coding error that causes the program to replicate its self
7 0
4 years ago
Define types of hacker ? with three to four line of each types?​
Strike441 [17]
1.) benevolent hackers are hackers that use their skills to assist people in getting back stolen information, and usually put bad people in their place
2.) malevolent hackers use their skills to cause harm to others by either stealing information or leaking it, hacking into social media accounts or by infiltrating computers and implanting malware of some kind, but this isn’t normally done by hacking, you can do it just by sending an email with a sneaky link or virus in it.
Those are the two main types but there are also hackers who work for the government as cyber security protection or even to hack into targets of the government.
5 0
3 years ago
Other questions:
  • What is Gamekit Loa3's all questsions
    14·1 answer
  • Your bank contacts you asking you to phone a number supplied in the email.What do you?
    13·2 answers
  • What is the first step to creating a PivotTable?
    9·2 answers
  • What is the efficiency (Big O Notation) of quicksort algorithm?
    15·1 answer
  • The company database may be stored on a central database server and managed by a database adminstrator true or false
    12·1 answer
  • Which quality allows programmers to modify a program as and when required
    11·2 answers
  • Asymmetric key encryption combined with the information provided by a. certificate authority allows unique identification of the
    8·1 answer
  • viewRatings(string, int) Takes a username and a minimum rating value. It prints all the books that the user has rated with a val
    10·1 answer
  • People who rely on others for financial support, such as children and the elderly, are referred to as 16 O A. recipients O B. be
    9·1 answer
  • What has happened (or is still happening) to make this speech occur? armageddon
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!