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
jeka57 [31]
4 years ago
11

Write a recursive C++ function that writes the digits of a positive decimal integer in reverse order.

Computers and Technology
1 answer:
dangina [55]4 years ago
4 0

Answer:

// here is code in c++.

#include <bits/stdc++.h>

using namespace std;

// recursive function to print digit of number in revers order

void rev_dig(int num)

{

  if(num==0)

  return;

  else

   {

       cout<<num%10<<" ";

       // recursive call

       rev_dig(num/10);

   }

}

// driver  function

int main()

{

   int num;

   cout<<"enter a number:";

   // read the number from user

   cin>>num;

   cout<<"digits in revers order: ";

   // call the function with number parameter

   rev_dig(num);

   

return 0;

}

Explanation:

Read the input from user and assign it to variable "num". Call the function "rev_dig" with "num" parameter.In this function it will find the last digit as  num%10 and print it. Then call the function itself with "num/10". This will print the second last digit. Similarly it will print all the digits in revers order.

Output:

enter a number:1234                                                                                                        

digits in revers order: 4 3 2 1

Diagram :

You might be interested in
Which of the following would allow for the QUICKEST restoration of a server into a warm recovery site in a case in which server
adelina 88 [10]

Answer: C. Differential backup

Explanation: There are several ways od ensuring the preservation and storage of data even cases of disaster, one of such ways is data data mirroring which allows data to be replicated or copied in real time and several backup options. In cases where there there is need to restore a server, the warm recovery site provides a data or disaster recovery option used to mitigate the effect of data loss on organization. In the absence of data mirroring, differential backup option, provides the quickest recovery option as it only requires changes in the data stored after the last full backup. These speed experieced should be expected due to the relatively low data been dealt with rather than the entire data.

5 0
3 years ago
When Kristy recently started a photography business, she downloaded Photoshop to her computer to edit her photos. She notices he
Evgesh-ka [11]

Answer: A. System window and C. System Information window

Explanation:

Hi, RAM stands for Random Access Memory. RAM stores information about running programs in your computer, as long the computer is on.

To know how much RAM is installed on a system you can use the system window tool.

In windows 10 Right click on "Start Menu" and click on "System" in pop-up menu to open "System" window.

System window will show basic information of the computer, including the amount of RAM installed.

Also you can Type "System Information" in the search box, and select "System Information" from search results.

"System Information" window shows a more detailed system summary, of hardware resources and devices. Incluiding RAM.

Feel free to ask for more if needed or if you did not understand something.

7 0
3 years ago
Design (draw a datapath) for a block that will help your processor decide whether to take a branch for different conditions. As
LekaFEV [45]

Answer:

See explaination

Explanation:

Here are the steps taken to draw the diagram!

opcode0 and the opcode1 signals are inverted/not to determine the case whether it is 00, 01, 10, 11.

Then they are 'and'ed with the corresponding Zero/lt signal to confirm if the case is true, for eg. zero = 1 if opcode = 00 (beq).

Then all the cases are 'or'ed to get the Branch signal!

See attachment for the diagram

8 0
3 years ago
Which tab on the Table Tools contextual tab is used to control the style and formatting of the table as it relates to colors for
laila [671]

Answer: The answer would be the "Home Tab"

Explanation:

4 0
3 years ago
I need help please and thank you
Evgen [1.6K]

Answer:

Explanation: For "BEST way to handle the situation," try Option 1, because it would possibly help them or make the Technical Support Representative do less work.

For "WORST way to handle the situation," Option 4 would be the best because you're basically just hanging up on the person.

5 0
3 years ago
Other questions:
  • Routing connects different network segments and decides where __________are sent to
    7·1 answer
  • When an item in a menu is black, it means that _____.
    6·2 answers
  • All 24-point fonts take up the same amount of space on a slide. True False
    7·2 answers
  • Huan wants to enter the science fair at his school. He has a list of ideas for his project. Which questions could be answered th
    14·1 answer
  • Which technique will NOT help you build rapport with your colleagues?
    15·1 answer
  • KDS Company has 3 departments: 1. Dept X 2. Dept Y 3. Dept Z. Design a program that will read as input each department's sales f
    6·1 answer
  • Which feature of REPL.it would you use to transmit your program to a friend?
    12·1 answer
  • Why is it a good idea not to change the subject line when replying to a message?
    8·2 answers
  • For which tasks is Layout view most helpful? Check all that apply.
    12·1 answer
  • if a user watches a video with event tracking three times in a single session, analytics will count how many unique events?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!