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
Write a HTML program as shown in the output.​
Vitek1552 [10]

Explanation:

<html>

<title>first term 9/<title>

<head>SUNGHAVA SHIKSHA NIKETANA</head>

<body>

<h1>maths formula</h1>

<h6>a2-b2=(a+b)(A-B)</h6>

<h1>list of exams<\h1>

<h6>1.computer,2.english,3science</h6>

</body>

</html>

3 0
3 years ago
The batteries on electric vehicles are recharged using electricity from either a wall socket or dedicated charging unit.
yuradex [85]

Answer:

true

Explanation:

7 0
3 years ago
If a line is 4’ and you scaled it using 1/8” =1’ what would the size of the line be?
Gnesinka [82]
One half inch to scale
8 0
3 years ago
How can volunteering to help plan a fundraiser for your team or club be a way to develop your strengths?
marshall27 [118]
It can help you develop your leadership trait
5 0
3 years ago
Read 2 more answers
A shuffle of two strings X and Y is formed by interspersing the characters into a new string, keeping the characters of X and Y
levacccp [35]

Shuffle (A[1..m], B[1..n], C[1..m+n]):

Shuf[0, 0] ← True

for j ← 1 to n

Shuf[0, j] ← Shuf[0, j − 1] ∧ (B[j] = C[j])

for i ← 1 to n

Shuf[i, 0] ← Shuf[i − 1, 0] ∧ (A[i] = B[i])

for j ← 1 to n

Shuf[i, j] ← False

if A[i] = C[i + j]

Shuf[i, j] ← Shuf[i, j] ∨ Shuf[i − 1, j]

if B[i] = C[i + j]

Shuf[i, j] ← Shuf[i, j] ∨ Shuf[i, j − 1]

return Shuf[m, n]

The algorithm runs in O(mn) time.

3 0
3 years ago
Other questions:
  • Music voice and sound effects can all be recorded and stored on a computer as
    15·1 answer
  • Where does the term for a star network describe? A) a network for Department of Defense scientists to share data about the stars
    13·2 answers
  • One megabyte is approximately __________.
    7·2 answers
  • You are asked to design a system of FP numbers representation (with your own design choices), labeled Custom_FP_48, for which we
    8·1 answer
  • Which of the following illustrations is depicted in the icon that's used to access Windows Help and Support files?
    13·1 answer
  • When does a soft page break occur in a document
    9·1 answer
  • What type of technology we need to use in order to make sure that users can freely room from one room to another one without wi-
    14·1 answer
  • Complete the sentence about entering and editing data in a cell in a spreadsheet.
    13·1 answer
  • (03.05 LC
    14·1 answer
  • T/F static development is the process of constructing the programs and code modules that serve as the building blocks of the inf
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!