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
expeople1 [14]
3 years ago
14

Write biggerDigits.cpp that has a function called biggerDigits that uses two positive integer parameters with the same number of

digits and returns an integer whose digit in each position is the bigger of the two digits in that position in the input parameters. If a negative parameter is given, or if parameters with unequal numbers of digits are given your function can return any result of your choosing. Use recursion.
cout << biggerDigits(567, 765) << endl; // prints 767
cout << biggerDigits(123456, 444444) << endl; // prints 444456
cout << biggerDigits(999, 111) << endl; // prints 999
Computers and Technology
1 answer:
fomenos3 years ago
7 0

Answer:

Following are the program in the C++ Programming Language:

#include <iostream> //header file

using namespace std; //namespace

int biggerDigits(int n, int m) { //define function

if (n <= 0 || m <= 0) { //set if statement

return 0;  

}  

else { //set else statement

int a,b; //set integer variables

a = n % 10; //perform modulatio  

b = m % 10; //perform modulatio

int max = a; //set integer variable and assign value  

if (b > max) //set if statement

max = b; //initialize value to max

/*solution is here*/

return 10 * biggerDigits(n / 10, m / 10) + max;

}

}

int main() // main method  

{ // code is refer from question to make the program

cout << biggerDigits(567, 765) << endl; // call the function biggerdigits

cout << biggerDigits(123456, 444444) << endl; // call the function biggerdigits

//call function and print result

cout << biggerDigits(999, 111) << endl; // call the function biggerdigits

return 0; // return the integer 0

}

Explanation:

Here, we set the header file "<iostream>" and namespace "std" then, we set a function "biggerDigits()" and pass two integer type arguments inside it.

  • we set if condition in which when the variable "n" is less than equal to 0 or m is less than equal to 0 then, it return 0.
  • we set the else statement inside it we set two integer type variables "a" and "b" then, perform modulation with both the variables.
  • we set integer variable "max" and assign value of a in it.
  • we set if condition in which we check when the variable b is greater than variable max then, initialize the value of variable b in the variable max and return the solution through recursion.
You might be interested in
Which of the following film pioneers helped make films widely available to ordinary people?
Verizon [17]
<span>Steven Spielberg, and or Paul Williams

</span>
6 0
3 years ago
Read 2 more answers
48
Irina-Kira [14]

The statement that best explains the benefit that higher page placement provides those who use search engine optimization well is option A. People are more likely to click the first results than those further down the page.

<h3>What advantages do search engine results pages offer?</h3>

Search engine results pages (SERPs) typically feature paid search and pay-per-click (PPC) advertisements in addition to organic search results. Since consumers are more inclined to click on results at the top of the page, ranking position on a SERP can be very competitive thanks to search engine optimization (SEO).

Therefore, Search engine optimization, or SEO, is the act of enhancing your website to raise its natural prominence for particular search queries. Through onsite adjustments, SEO seeks to increase both the quality and volume of traffic to your website.

Learn more about search engine optimization from

brainly.com/question/14097391
#SPJ1

3 0
1 year ago
Digital _________ Line is a family of point-to-point technologies designed to provide high-speed data transmission over traditio
disa [49]

Answer:

D. Subscriber

Explanation:

Digital Subscriber Line is a family of point-to-point technologies designed to provide high-speed data transmission over traditional telephone lines.

The high speed data transmission property helps to transmit data in a fast and timely manner between two or more points or people during calls, texts and other activities.

6 0
3 years ago
What are some fun games to play on you phone?
musickatia [10]
Madden,clash of clans
8 0
3 years ago
Read 2 more answers
Can a idler gear increase or decrease torque?
Lady bird [3.3K]

answer:The gear is called an idler and its primary function is to change the direction of rotation rather than decrease the speed or increase the torque. Calculating the gear ratio in a planetary gear reducer is less intuitive as it is dependent on the number of teeth of the sun and ring gears.

Explanation:

8 0
3 years ago
Other questions:
  • The ListIterator interface
    13·1 answer
  • Who found a way of making the steam engine more efficient?
    9·2 answers
  • Some files appear dimmed in one of the default folders on your computer. What would be the best course of action? A. Leave the f
    5·1 answer
  • Which tabs are expandable and collapsible? This would be in word 2010
    6·1 answer
  • Which of the following is an example of a complex formula
    8·1 answer
  • Explain steps in creating a main document for from letter. <br>​
    5·1 answer
  • Juan has performed a search on his inbox and would like to ensure the results only include those items with attachments which co
    14·2 answers
  • The development of the modern computer system has been evolutionary. Discuss this phenomenon and further discuss how current tre
    7·1 answer
  • Which of these is unused normal, unvisited link ??
    12·1 answer
  • Which type of software is created on user dimension​
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!