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
2. Create 4 riddleson keywords which is related to fire wall.​
Alona [7]

Answer:

It's been so good to have you as a friend:

2. As sweet and rich as honey-colored sun

3. Slanting steep across a summer lawn,

4. Gilding life with all that love can lend.

5. And now that you yourself have griefs to tend,

6. I want to be the strong and caring one

7. To count to you the lovely things you've done

8. Until these troubles pass and sorrows end.

9. You are so beautiful in form and soul

10. That you bring happiness to all you're near:

11. Just as a sea rose, flowering in mist,

12. Makes a paradise of some bleak shoal,

13. Turning truth to something far more clear,

14. No pain unsoothed or rain-swept cheek unkissed.

good~0~as_a_friend . good_to_have~Slanting~lawn .

It's_been~so_good~as_a_friend .

to_have~griefs_to~form_and_soul

Explanation:

7 0
3 years ago
Assume you are part of the systems development team at a medium-sized organization. You have just completed the database design
nexus9112 [7]

Answer:

Please see the attached file for the complete answer.

Explanation:

Download pdf
5 0
3 years ago
If you want an app to reach the largest possible audience, which two platforms should you use?
Papessa [141]

Android Studio for Android, and Xcode for Apple devices.

6 0
2 years ago
A special case of the non-inverting amplifier is when
Aneli [31]

Answer:

c-Either A or B

Explanation:

The non-inverting amplifier usually has the input voltage connected to the non-inverting input while the inverting input is connected to the output.

Both the unit gain amplifier and the voltage follower have an input voltage connected to the non-inverting input, and the inverting input connected to the output, so both are special cases of the non-inverting amplifier.

The correct answer is

c-Either A or B

4 0
3 years ago
What is a algorithm?
Basile [38]
A process or set of rules to be followed in calculations or other problem-solving operations, especially by a computer.
4 0
3 years ago
Read 2 more answers
Other questions:
  • 안녕하세요! 한국어도 여기서 사용 가능한지 궁금합니다.
    6·2 answers
  • Choose the word that best completes this sentence. ____________ should cover every part of the worksite.
    10·2 answers
  • Explain the purpose of QoS on a TCP/IP network. Define the basic purpose of IP prece- dence, Type of Service, Diffserv, and Expl
    11·1 answer
  • Someone plzzzz help me
    5·1 answer
  • How to cheat on asseeprep
    6·1 answer
  • If you delete a conversation many times with someone like this, will you stop receiving messages from them?
    13·1 answer
  • A characteristic often associated with entrepreneurship is
    9·1 answer
  • What does getfenv() do?
    11·2 answers
  • What is modularity?
    9·1 answer
  • Briefly define each components of information systems (hardware, software, data, networking, people and procedure). While you ar
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!