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
Which stage best represents the developing of documents that provides the basis for acquiring the resources and for developing a
UkoKoshka [18]

Answer:

The answer to this question is given below in the explanation section.

Explanation:

The correct answer to this question is the planning stage. Because the planning stage represents the development of documents that provide the basis for acquiring the resources and for developing the requirement document. at this stage, you plan about what you are going to develop and how to develop it. At this stage, you come out mainly with two documents i.e. project proposal and requirement document.

Other options are not correct because:

In the project management, after planning, you will start designing the product, and after designing you start developing the product, and at the implementation stage, you implement or deploy the product to the customer or to the client. The requirement document that is developed at the planning stage can be used in the later stages of the project.

7 0
3 years ago
Which program will have the output shown below?
Nutka1998 [239]

Answer: Python

Explanation: All I know is that the programming language is Python.

8 0
3 years ago
Read 2 more answers
List out 20 output devices ​
GaryK [48]

Answer:

20 Examples Output Devices

Monitor.

Printer.

Audio Speakers.

Headphones.

Projector.

GPS.

Sound Card.

Video Card.

7 0
3 years ago
Read 2 more answers
You are experiencing a problem with a network server. You want to bring the system down and try reseating the cards within it be
Ymorist [56]

Answer:

"init 0" command completely shuts down the system in an order manner

Explanation:

init is the first process to start when a computer boots up and keep running until the system ends. It is the root of all other processes.

İnit command is used in different<em> runlevels, </em>which<em> </em>extend from 0 through 6. "init 0" is used to halt the system, basically init 0

  • shuts down the system before safely turning power off.
  • stops system services and daemons.
  • terminates all running processes.
  • Unmounts all file systems.
7 0
3 years ago
Please help me answer this question
Korolek [52]

Answer:

the arrow goes counter clockwise

Explanation:

In the battery symbol, the large line represents + and the smaller, thick line represents -. Since current flows from + to -, the direction is counter clockwise.

7 0
2 years ago
Other questions:
  • IF ACCURATE = BRAINLY (if u answer rubbish randomness= reported AND if you got questions dont ask in answer slot= reported)
    13·1 answer
  • To combat piracy, many software publishers require users to type in a(n) ____ code, a sequence of numbers and letters in order t
    10·1 answer
  • You start up your laptop while getting a coffee across the room. You hear the usual chimes and doinks as it starts up. When you
    14·2 answers
  • g Define memory hierarchy. A. The rate at which information can be transferred from one place to another. B. Ordering storage sy
    8·1 answer
  • The program DebugTwo2.cs has syntax and/or logical errors. Determine the problem(s) and fix the program.// This program greets t
    5·1 answer
  • State Whether the given statement are TRUE OR FALSE. 13X1=13
    10·1 answer
  • Html code to hyperlink file​
    12·1 answer
  • I think you have been doing a great job but you haven’t been signing many people up for our new service feature I want you to se
    8·1 answer
  • What are 5 good movies like The Breakfast Club or 8 Mile?
    14·2 answers
  • An opening inside the system unit in which you can install additional equipment can be known as
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!