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
Manuel is working on a project in Visual Studio. He wants to keep this program showing on the entire desktop, but he also needs
patriot [66]

Answer:

d. Task View

Explanation:

Based on the scenario being described within the question it can be said that the best feature for this would be the Windows 10 task view. This is a task switcher and  virtual desktop system included in the Windows 10 operating system, and allow the individual user to quickly locate, manage, open or hide different windows/tasks. Such as having several projects open in different monitors running at the same time.

3 0
3 years ago
_________________ ___________________ is an encrypted code that a person, website, or organization attaches to an electronic mes
Blizzard [7]

Answer:

Digital Signature

Explanation:

Digital Signatures are used in electronic messages to verify the sender's ıdentity. It is a online signature and highly secure way of proving identity.

The Signature is <em>encrypted</em> and can be decoded using <em>public-key</em> .

Digital signatures are certificated uniquely from accredited providers, encrypted and can be validated by certificate authorities.

Messages with digital signatures prove that the message sent by the owner of the signature and didn't changed on the way.

4 0
3 years ago
Pix blocks półfinały skilled
jasenka [17]

mam  ,,4 6 7 12 15 .18.20.

6 0
3 years ago
Write pseudocode instructions to carry out each of the following computational operations:1. Determine the area of a triangle gi
Zinaida [17]

Answer:

Hi there! The question is checking your knowledge on Pseudocode. Pseudocode is a high level solution written in plain English to outline the steps needed for the program to work correctly. An implementation for the different parts of the question is written below.

Explanation:

1. Determine the area of a triangle

  declare formula for area calculation of triangle as ½ * (base * height)

  validate input parameters “base” and “height”

  apply formula and return result

2. Compute the interest earned Prompt user for input 2

   declare formula for interest calculation as annual interest rate * term *     starting account balance

   validate input parameters “interest_rate” and “starting_account_balance ”

   apply formula and return result as final balance at the end of the year as the interest earned + starting balance.

3. Determine the flying time between two cities given the mileage M between them and the average speed of the airplane.

   declare formula for time calculation of triangle as time = distance / speed

   validate input parameters for mileage “M” and speed “S”

   apply formula and return result

7 0
3 years ago
Assuming arrayName is the name of an array and identifier is a name of a variable that has the same data type as the array eleme
creativ13 [48]

Answer:

The answer is "Option a"

Explanation:

Range-based for loop performs a sequence for a loop. It's more accessible as the conventional loop, for example, all components in the array, running more than a range of possibilities. In the given question "option a" is correct because it follows the correct syntax and other choices were wrong, which can be described as follows:

  • In option b, It's not correct, because in this code the range declaration is wrong.
  • In option c, It is wrong, because in this code the datatype is missing.  
  • In option d, It is illegal syntax, that's why it is wrong.
5 0
3 years ago
Other questions:
  • In three to five sentences, describe how you can organize written information logically and sequentially
    8·1 answer
  • Brittany just pulled up a database table with employee information that contains 50 records of employees at her company. Which o
    12·1 answer
  • When selecting text in word, holding down the ctrl key while clicking the mouse button will select the?
    15·1 answer
  • How to turn a flash drive into a bluetooth adapter?
    13·1 answer
  • _______ data would be useful for creating a report containing last year's revenue, which won't be changing.      A. Integrated B
    12·1 answer
  • The Windows Remote Desktop Web connection that allows users to connect to a work or home computer and access files is considered
    7·2 answers
  • Justify any FOUR significant factors to remember when installing your motherboard
    7·1 answer
  • The Curiosity Rover has recently landed on Mars and likes to send Twitter updates on its progress. If a tweet is posted 10 minut
    6·1 answer
  • Use the drop-down menus to explain what happens when a manager assigns a task in Outlook.
    6·2 answers
  • What is required to publish documents on the Web
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!