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
e-lub [12.9K]
3 years ago
10

Write a function that takes an integer and reverses the digits. The function returns the reversed number to main. Here is the pr

ototype for this function. Write main() to test this function. Use only int data type and arithmetic to solve this problem.
Computers and Technology
1 answer:
laila [671]3 years ago
5 0

Answer:

The prototype part missing has been assumed to be:

int reverseNum (int num);

Code:

#include <iostream>

using namespace std;

int reverseNum(int num);

int main()

{

int num=0,result=0;

cout<<"Enter the number:";

cin>>num;

result=reverseNum(num);

cout<<"The reversed number :"<<result<<endl;

return 0;

}

int reverseNum(int num)

{

int temp=0,digit=0;

for(num;num>0;num=num/10)

{

digit=num%10;

temp=temp*10+digit;

}

return temp;

}

Explanation:

You might be interested in
Four actions that can be implemented on a database to autocorrect violations of referential integrity, and the outcomes of the a
Paraphin [41]

Answer:

Follows are the matching to this question:

Option \ a \to \ Option \ 3\\\\Option \ b \to \ Option \ 4\\\\Option \ c \to \ Option \ 1\\\\Option \ d \to \ Option \ 2\\

Explanation:

While time-consuming or prone to errors mechanical adjustments to both the referential, databases could be configured with four measures to engine violations. The restricted action causes the insert, update, and removes to only be denied. Set Null to NULL sets the invalid external key, whereas Set Default to a specific core consideration specified in SQL sets a default foreign key. Its Cascade operation spreads the main changes in external keys.

6 0
3 years ago
Which of the following tasks requires you to use the Tabs option?
LenaWriter [7]
In Microsoft Word, the TAB button shifts the text to the right. For example, starting a new paragraph, the TAB button indents the beginning.<span />
3 0
3 years ago
Click cell i13 and calculate the agent commission using the base cost of the trip and a vlookup function that returns the commis
TiliK225 [7]
All you need to do is use excell.
5 0
3 years ago
Which of the following is an example of synchronous communication?
kirza4 [7]

The answer is D) on Oddessey Ware

4 0
3 years ago
What skill would be easiest to learn from a simulation video game?
garik1379 [7]

Answer:

D

Explanation:

the first three you would need hands-on practice to learn.

5 0
3 years ago
Read 2 more answers
Other questions:
  • You can create a ____ partition to hold files that are created temporarily, such as files used for printing documents (spool fil
    13·1 answer
  • What type of interview would be most likely for the following scenario?
    11·2 answers
  • What is the symbol for the relational operator 'equal to'?
    8·1 answer
  • What car Is this because I want it for my daughters sweet 16th birthday
    13·1 answer
  • How long would it take a 8 bit computer to calculate π to the thousandth place?
    8·1 answer
  • Which of the following sections of a business plan comes first but should be written last?
    11·2 answers
  • A drink costs 2 dollars. A taco costs 5 dollars. Given the number of each, compute total cost and assign to totalCost. Ex: 2 dri
    11·1 answer
  • Please tell fast plzzzzzzzz​
    11·2 answers
  • Misspelet errors are displays with a ...<br>.. below them<br>​
    10·1 answer
  • "If possible, always bring print-outs of your slides for your audience
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!