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
alexira [117]
4 years ago
15

Write a recursive function that takes a non-negative integer as an argument and displays the same number in reverse order (i.e.

in order from right to left). For example, if the argument is 76538, it would display 83567.
Computers and Technology
1 answer:
avanturin [10]4 years ago
5 0

Answer:

Following are the program in C++ language

#include<iostream> // header file

using namespace std; // namespace std

int reverse(int n1); // function prototype

int main()  // main function()

{

   int num; // Variable declaration

   cout << "Enter the number" << endl;

   cin >> num; // Read the number bu the user

  cout<<"After Reverse the digit:\n";

   int res= reverse(num); // calling function reverse

   

   cout<<res; // display  

}

int reverse(int n1) // function definition of reverse

{

   if (n1<10)  // checking the base condition

       {

           return n1;

       }

   else

       {

           cout << n1 % 10; // Printed the last digit

          return reverse(n1/10); // calling itsself

}

}

Output:

Enter the number:

76538

After Reverse the digit:

83567

Explanation:

Following are the description of the program

  • In the main function read the number by user in the "num" variable of int type.
  • Calling the reverse and pass that "num" variable into it.
  • After calling the control moves to the body of the reverse function.In this function we check the two condition

        1  base condition

   if (n1<10)  // checking the base condition

       {

           return n1;

     }

      2  General condition

  else

       {

           cout << n1 % 10; // Printed the last digit

          return reverse(n1/10); // calling itsself

       }

  • Finally return the reverse number and display them into the main function.
You might be interested in
A piano manufacturer employs piano technicians who inspect instruments before they are shipped to customers: a.When inspecting a
77julia77 [94]

Answer:

a.When inspecting an instrument, Technicians apply specific Inspection Tests; more than one Test can be applied for an inspection. Each piano is inspected by at least one technician, and a technician can inspect more than one instrument.

Explanation:

An Inspection test  is a formal approach used to test a system or product such as machines, package, software. This can be done by dimension inspection,  visual inspection, welding inspection, function test, factory acceptance test. Three major factors to be considered in the test plan include:

Test Coverage,

Test Methods, and

Test Responsibilities

There are specific inspection tests that should be applied when inspecting an instrument. A technician can apply more than one test type to assess the authenticity of a product. More than one technician is needed to ascertain the working mehanism of a machine to ensure it has no fault. A technician  can inspect more than one instrument depending on his diversity of specialization.

5 0
3 years ago
Write an algorithm and draw a flowchart to count the digits present in the given integer. ​
saul85 [17]

Answer:

The algorithm is as follows:

Input number  

count = 0

while(number not equal 0)

   number = number / 10

   count = count + 1

end

Print count

Explanation:

This gets input for the integer number

 Input number  

This initializes count of digits to 0

count = 0

The following loop is repeated while number is not 0

while(number not equal 0)

This performs integer division of the number by 10; the resulting division is saved in variable number

   number = number / 10

The count variable is incremented by 1

   count = count + 1

The loop ends here

end

This prints the count of integers

Print count

<em>See attachment for flowchart</em>

8 0
3 years ago
time to throw poggers xqc time to throw pogchamp time to throw pogchamp time to throw pogchamp time to throw pogchamp time to th
Effectus [21]
Yes thank you very much
6 0
3 years ago
Read 2 more answers
Jasmine took many pictures at a photo shoot. She wants to transfer these pictures from her camera to her laptop for image enhanc
hoa [83]
The answer would more likely be A
If it’s not correct I’m very sorry
5 0
3 years ago
How does computer applications affect our lives daily? 1- paragraph (4 sentences)
Mnenie [13.5K]

Answer:

Computers affect our lives daily because we use them everyday to browse the internet and solve problems in real life. They help solve problems and without them, getting certain information would be much harder. They help us interact with friends from anywhere in the world and communicate with relatives. It has also helped us during this pandemic and lets us learn from school in the safety of our own home.

( hope this helps, i wrote it myself ;-; )

4 0
3 years ago
Read 2 more answers
Other questions:
  • Suppose you develop an app and want to generate revenue but do not want to maintain the app. What would be your best choice?
    9·1 answer
  • The company involved in an attack by Oleg Zezev from Kazahkstan, in which Zezev accessed computer data and copied personal infor
    12·1 answer
  • is this website just for a bunch of lazy kids bumming off answers? Because if that were the case I'd be one of them.
    9·1 answer
  • If I deal seven cards from a standard deck of 52, what is the chance that I will get two triples (three of a kind) and one other
    11·2 answers
  • Which is currently the most common cellular network?<br> 4G<br> 4G LTE<br> 5G<br> 5G LTE
    13·1 answer
  • Describe an algorithm that, given n integers in range 0 to k, preprocesses its input and then answers any query about how many o
    15·1 answer
  • Which of the following is not an example of Detailed Demographics?
    11·1 answer
  • Only need help on f and correct me if im wrong for the other questions please
    11·1 answer
  • Apart from using secure networks, how else can Dhruv keep his deliverables safe in the office and on the go? Select all that app
    8·1 answer
  • B. WAP to check whether input number is palindrome number or not using SUB...... END SUB.​
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!