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
White raven [17]
2 years ago
15

Write a recursive function that returns true if the digits of a positive integer are in increasing order; otherwise, the functio

n returns false. Also, write a program to test your function.

Computers and Technology
1 answer:
deff fn [24]2 years ago
4 0

Answer:

C code implementing the function:

#include<stdio.h>

int isIncreasing(int m);

void main()

{

int y, t;

 

printf("Enter any positive integer: ");  

scanf("%d", &y);

 

t= isIncreasing(y); //call the functoion isIncreasing(int m)  

 

if(t==1) //if isIncreasing(int m) returns 1, then the digits are in //increasing order

 printf("True:  The digits are in increasing order");

else

 printf("False:  The digits are not in increasing order");

}

int isIncreasing(int m)

{

int d1,d2;

if(m/10==0) //if we reach till the left of left most digit, then all before  //digits were in order. else it won't go upto that.

{

 return 1;

}

d1 = m%10; //d1 holds the right most digit of current m.

if(m%10 !=0)

{

 m = m/10; //m is updated to find the rest digits and compare //them.

 d2 = m%10;//d2 holds the digit just left of the right most digit of //m.

 if(d2 <= d1) // if the right most and it's left digits are in order then //we proceed to left.

 {

  isIncreasing(m);

 }

 else   //else we stop there itself, no need to move further.

  return 0;

}

}

output is given as image.

You might be interested in
What is the primary way to access applications in window 10
Alex787 [66]

Choose Start, type the name of the application, like Word or Excel, in the Search programs and files box. In the search results, click the application to start it. Choose Start > All Programs to see a list of all your applications. You might need to scroll down to see the Microsoft Office group.

8 0
3 years ago
Frankie used the ps command to find the process id of an application that he needs to stop. What command-line tool should he use
ASHA 777 [7]

In the case above, the command-line tool should he use to stop the application based on its process id is e option

What is the use of ps command?

The ps command is known to be one that helps enables a person to be able to look at the status of any kind of active processes on a system, and also that of display technical information in regards to the processes.

Note that In the case above, the command-line tool should he use to stop the application based on its process id is e option

Learn more about command-line tool from

brainly.com/question/3737699

#SPJ1

7 0
2 years ago
Households pay taxes to the government and receive public services. Which of the following is a public service?
Gwar [14]
C. Roads  this is the correct answer
8 0
3 years ago
15
valina [46]

Answer:

B.

shutter priority mode

Explanation:

Shutter Priority, which is mentioned as S on the mode dial, and the mode is  the time value, and is demoted as Tv, that points out to the setting in different forms of cameras that allows all to select a particular shutter speed, and as meanwhile the camera balances the aperture to ensure correct exposure in the image.

7 0
3 years ago
Read 2 more answers
If one wanted to use the best method to get storage into long-term memory, one would use _________. maintenance rehearsal rote r
anzhelika [568]

Answer:

elaborative rehearsal

Explanation:

when it comes to storage of information or data into long term memory then elaborative rehearsal plays an important role.

Elaborative rehearsal is a technique which focuses on thinking about the piece of information or data's meaning which is to be stored in long term memory and linking it with the information or data which is already present or stored.

7 0
3 years ago
Other questions:
  • what is the restaurant with the black pom tree and yellow backround three letter name from hi guess the restaurant
    14·2 answers
  • During the charging of a storage battery, what is the temperature that the electrolyte solution must never exceed?
    6·1 answer
  • Define and test a function myRange. This function should behave like Python’s standard range function, with the required and opt
    11·2 answers
  • What is the post condition of an expression or variable
    11·1 answer
  • Fedora operating system
    9·1 answer
  • A struggle between opposing forces or characters is
    14·1 answer
  • One page of content in a PowerPoint presentation is referred to as a
    12·1 answer
  • Is anyone really good at immerse 2 learn??
    9·1 answer
  • Can some one help sorry I just so confused on this and I keep failing it I just need the help So choose the best answers
    12·1 answer
  • Indicate if the statement is true or false False 1. A spreadsheet cannot recalculate after you have changed data in your workshe
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!