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
How would you describe the difference between a syntax error and a logic error?
Ugo [173]

Answer:

hii

Explanation

syntax error:  a syntax error is an error in the syntax of a sequence of characters or tokens that is intended to be written in compile-time. A program will not compile until all syntax errors are corrected.

logic error:  logic error is a bug in a program that causes it to operate incorrectly, but not to terminate abnormally. A logic error produces unintended or undesired output or other behaviour, although it may not immediately be recognized as such.

6 0
3 years ago
Read 2 more answers
An administrator needs to set up an authentication server for users connecting to a network through a VPN. What kind of server c
nalin [4]

Answer:

RADIUS

Explanation:

RADIUS is the networking protocol that is used for the purpose of authentication to access the network resources. The full form of RADIUS is Remote Authentication Dial In User Service. It is used by different organizations, which setup their own network that can be accessible through VPN, DSL or modems through different networks. The purpose of this protocol is to establish the security and authentication mechanism by organization itself.

So, If an administrator needs to set up an authentication server for users connecting to a network through a VPN, he should establsih the RADIUS based Server.

3 0
3 years ago
Clickstream tracking tools collect data on customer activities at web sites (true/false)?
Galina-37 [17]

Clickstream tracking tools collect data on customer activities at websites- true.

<h3>what is the website?</h3>
  • A website, often known as a website, is a collection of web pages and associated material that is published on at least one web server and given a shared domain name.
  • The World Wide Web is the aggregate name for all publicly accessible websites.
  • A company's internal website for its workers is an example of a private website that can only be viewed via a private network.
  • Most websites focus on a single subject or objective, including news, education, business, entertainment, or social networking.
  • The navigation of the website, which frequently begins with a home page, is aided by hyperlinks between web pages.

To learn more about website, refer to the following link:

brainly.com/question/9060926

#SPJ4

3 0
1 year ago
Which option for creating a table involves the use of a grid of squares?
SSSSS [86.1K]
It’s draw table iirc
4 0
3 years ago
Read 2 more answers
You should always buy the biggest camera bag that you can find for extra equipment.
Akimi4 [234]

Answer:

true

Explanation:

7 0
3 years ago
Read 2 more answers
Other questions:
  • The _____ command icon looks like a small clipboard with a page attached.
    6·1 answer
  • When are numbered lists generally used?
    14·2 answers
  • Which of the following characters is not allowed for java variable names
    7·1 answer
  • What is the purpose of system calls, and how do system calls relate to the OS and to the concept of dual-mode (kernel-mode and u
    14·1 answer
  • What is an efficient way to ensure that the code is working as per the acceptance criteria/business requirements? (1 correct ans
    11·2 answers
  • When projecting a presentation on a large screen, what should your minimum font size be?
    6·2 answers
  • Discuss what repetitions structures are, and how they differ from the vectorization approaches we have previously studied in the
    10·1 answer
  • Who has gotten a random file link from someone? What file does it contain?
    8·2 answers
  • What is the output?
    7·1 answer
  • when you insert a new column, the existing columns are shifted to the ____ and the new column has the same width as the column d
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!