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
Someone who wants to learn a skilled trade on the job should consider
Alexeev081 [22]
Someone who wants to learn a skilled trade on the job should consider enrolling in class for the knowledge and skills.
5 0
3 years ago
Read 2 more answers
Harvey is not happy with the software that allows the programmer to write and run code and wants to find something new. If Harve
Assoli18 [71]

Answer:

D. integrated development environment

Explanation:

Given that an integrated development environment is a form of computer software App that allows the users or programmers to develop a software App in a way the enables them to carry out different operations including source code development, build and test automation, and debugging activities.

For example NetBeans, Eclipse, IntelliJ, and Visual Studio.

Hence, in this case, the correct answer is "integrated development environment."

3 0
3 years ago
Two functions of the UPS​
Angelina_Jolie [31]

Answer:

UPS is abbreviation of Uninterrupted power supply. It is a battery backup devices useful when major supply is interrupted due to any reason.

It performs the following functions:

1. It provides protection from power surges.

2. Smooth out noisy power sources

5 0
3 years ago
Read 2 more answers
What are the benefits of a relationship in RDBMS <br>​
natali 33 [55]

Answer:

To sum up all the advantages of using the relational database over any other type of database, a relational database helps in maintaining the data integrity, data accuracy, reduces data redundancy to minimum or zero, data scalability, data flexibility and facilitates makes it easy to implement security methods.

Explanation:

I hope it helps you..

Just correct me if I'm wrong..

4 0
2 years ago
Which advertising medium has the widest reach on a global front?
lesya [120]

Answer: B

The internet would allow businesses to easily expand globally with the help of social media and the ever expanding resources being poured onto the internet, reaching customers anywhere in the world.

8 0
3 years ago
Other questions:
  • ________ symbol is used in the "Advanced" section of the time range picker to round down to nearest unit of specified time.
    8·1 answer
  • If you print a document with red green or blue underlines will they show up on printed pages
    14·1 answer
  • Marginal ________ shows how much money can be made if a producer sells one additional unit of a good.
    7·2 answers
  • What is the name of the amount of space between the content of a document and the edge of the page
    13·1 answer
  • Each processor core on a multi core processor generally runs faster than a single core processor
    14·2 answers
  • What is the reasoning you would write an inquiry to a company?
    5·2 answers
  • Does anybody know how to unlock websites from school computer
    7·1 answer
  • Mobile devices have their own OSs, tailored to their handheld needs, which means they are not immune to what?
    14·1 answer
  • Which type of shape allows you to add text that can be moved around.
    11·1 answer
  • Please help me with coding!
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!