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]
3 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]3 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
Can Any body Define what is search engine in a simple language quick please​
Komok [63]

Answer:

It is the SQL of WWW. Or in other words, it is the web tool that helps the users in locating the required information on the WWW. Various top search engines are like Google, MSN, and Yahoo. And the information that is gathered by the spider is used for creating the searchable index for the content on the web. This spider crawls according to the search engine algorithm and that is known as web crawling.

Explanation:

Please check the answer section.

6 0
3 years ago
Fill in the blank
EastWind [94]

Answer:

It is called the ENQUIRE database

Explanation: got it right boooiiiii

7 0
3 years ago
Read 2 more answers
A top level class may have only the following accessmodifier.
GREYUIT [131]

Answer: Public

Explanation:

 A top level class can have a public, as top level cannot be private and protected because the modifier private is not allowed. As, top level is a class which is not a nested class. Interface of a access modifier is either public or no modifier. There are two types of access control modifier are top level - public and member level- private, protected.

3 0
3 years ago
Fungsi radio adalah..?
malfutka [58]

Answer:

lebih lanjut bahwa radio mempunyai fungsi sebagaimana media- media lain yaitu memberikan informasi/to inform, memberikan pendidikan/to educate, memberikan hiburan/to intertain, fungsi memengaruhi/to influence, dan fungsi pengawasan to control.

<h2>translate;</h2>

Furthermore, radio has a function like other media, namely to provide information/to inform, provide education/to educate, provide entertainment/to intertain, function to influence/to influence, and control function to contact.

Explanation:

8 0
2 years ago
When researching Information about technology for use in a project, it is NOT important to consider the date that the informatio
REY [17]

Answer:

B. False

Explanation:

Hope this helps!

4 0
2 years ago
Other questions:
  • Someone is retiring next year. What would be an appropriate amount of risk to take their investments?
    8·2 answers
  • The ____________ mechanism consists of a lever arm attached to the mousetrap spring.
    15·1 answer
  • Which of the following is not a location where text can be entered​
    15·1 answer
  • Write a function ngrams(n, tokens) that produces a list of all n-grams of the specified size from the input token list. Each n-g
    6·1 answer
  • Which of the following things could you do in order to tell if a pair of colors has strong contrast? A. Look at the colors on th
    12·1 answer
  • The fill command try’s to fill or generate content for cells based on a ________.
    15·1 answer
  • Plz tell me how to get my deleted account back you will be highly PRAISED!!!!!!!!!!
    14·2 answers
  • D is the correct answer
    8·2 answers
  • How do we prevent electrical problems as prescribe by the course?​
    11·1 answer
  • Explain how communication facilitate cordination​
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!