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
Studentka2010 [4]
3 years ago
12

Consider the following definition of the recursive function mystery. int mystery(int first, int last) { if (first > last) ret

urn 0; else if (first == last) return first; else return first + mystery(first + 1, last - 1); } What is the output of the following statement? cout << mystery(6, 10) << endl;
Computers and Technology
1 answer:
krek1111 [17]3 years ago
6 0

Answer:

21

Explanation:

You might be interested in
a. Daily Life Magazine wants an analysis of the demographic characteristics of its readers. The marketing department has collect
kherson [118]

Answer:

uh

Explanation:

7 0
2 years ago
Write a Java program that prompts the user to enter integer values for the sides of a triangle and then displays the values and
satela [25.4K]

Answer:

import java.util.Scanner;

public class triangle {

       public static void main (String [] args) {

           int sideOne, sideTwo, sideThree;

           Scanner in = new Scanner (System.in);

           System.out.println("Enter the first side of the triangle");

           sideOne = in.nextInt();

           System.out.println("Enter the secon side of the triangle");

           sideTwo = in.nextInt();

           System.out.println("Enter the third side of the triangle");

           sideThree = in.nextInt();

           if ( sideOne<=0||sideTwo<=0|| sideThree<=0){

               System.out.println(" The Values enter are "+sideOne+ "," +sideThree+ ","+sideThree+ " These values don't make a valid triangle");

           }

           else if ((sideOne + sideTwo> sideThree) || (sideOne+sideThree > sideTwo) || (sideThree+sideTwo > sideOne))

           {

               System.out.println ("The triangle is Valid");

           }

           else {

               System.out.println(" The Values enter are "+sideOne+ "," +sideTwo+ ","+sideThree+ " These values don't make a valid triangle");

           }

       }

Explanation:

for a Triangle to be Valid one of the three sides of the triangle must greater than the other two sides.  The code above enforces this condition using an if statement in combination with the Or Operator

The following conditions where enforced

side one, side two and side three != 0

Side One + Side Three > Side Two

Side Three + Side Two> Side One

Side Two + Side One > Side Three

7 0
3 years ago
What is software piracy
Tju [1.3M]
Software piracy is the illegal copying, distribution, or use of software.
8 0
3 years ago
Read 2 more answers
The shapes of AND, OR, and NOR gates have something in common. What is it and why do you think they share that feature?
irina1246 [14]
There're all conjunctions.

You can seperate them in sentences after a comma for a run-on sentence.
4 0
2 years ago
What sentence could Lou’s granddaughter not answer? Explain the context and discuss whether you could answer this question or no
Tanya [424]
He wouldn’t answer the context for the discussion
7 0
2 years ago
Other questions:
  • dentify the type of observational study​ (cross-sectional, retrospective, or​ prospective) described below. A research company u
    5·1 answer
  • Match the elements of a web page with their descriptions?
    15·2 answers
  • Which types of files can be used to define Kubernetes manifest files? yaml, json, yaml and text files
    5·1 answer
  • What is the command to list the contents of directors in Unix- like operating system
    10·1 answer
  • What is the first priority when building or using vex robots
    10·2 answers
  • Type the correct answer in each box. Spell all words correctly.
    14·2 answers
  • The most important part of a computer​
    14·2 answers
  • What to do if you click on a phishing link on iphone
    9·2 answers
  • In the year, , the American Department of Defense put a military research network, called ARPANET online.
    5·1 answer
  • Write a while loop that continues to increment uservalue by 5 as long as uservalue is less than 0.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!