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
Bond [772]
3 years ago
7

Given the following code segment, what is output after "result = "? int x = 1, y = 1, z = 1; y = y + z; x = x + y; cout <<

"result = " << (x < y ? y : x) << endl;
a. 2
b. 3
c. 4
d. 1
Computers and Technology
1 answer:
Katyanochek1 [597]3 years ago
4 0

Answer:

The answer is "Option b".

Explanation:

  • In the C++ language program code, there are four integer type variable is defined that is "x, y,z, and result" in which variable x,y,z holds a value that is "1" and the variable result does not hold any value.  
  • In the next line, variable y holds added value of variable y and z, which is equal to 2. and variable x holds added value of variable x and y, which is equal to 3.
  • In the next line, a Ternary Operator is defined, it is similar to an if-else statement. This operator checks if x variable value is less then y. If this condition is true, it will print y variable value Otherwise, it will print x variable value. That's why the out to this question is "option b".
You might be interested in
PLEASE HELP!!!!!!!!!!!
Dafna1 [17]
I'd say Davis was trying to increase persuasive power. Given that he saw that nobody was really his friend because he was shy and quiet, he tried to persuade people to like him by going to the game and hanging out with people. 
4 0
3 years ago
Read 2 more answers
The design strategy that starts with a global view of the entire problem and breaks the problem down into smaller, more manageab
In-s [12.5K]

Answer:

Top down design

Explanation:

Top-down design is an approach that is used to break down the problem into the smaller subpart so that it can be manageable into more clear form.

C programming is the example of a top-down approach while C++ is the example of the bottom-up approach.

The advantages of the top-down design approach are:

1) easy to manage

2) easy to find the error

3) easy to debug

4 0
3 years ago
Chase lives in Oregon but works for a company that is located in Florida. What business trend is this an example us?
shtirl [24]

Answer:

The business trend wherein Chase works for a company that is located in Florida while he is living in Oregon is an example of remote workforce business trend.

Remote workers are those workers who does their job outside of a customary type of office.

8 0
3 years ago
Read 2 more answers
A recursive method may call other methods, including calling itself. Creating a recursive method can be accomplished in two step
liq [111]

Answer:

Explanation:

The following code is written in Java. It creates the raiseToPower method that takes in two int parameters. It then uses recursion to calculate the value of the first parameter raised to the power of the second parameter. Three test cases have been provided in the main method of the program and the output can be seen in the attached image below.

class Brainly {

   public static void main(String[] args) {

       System.out.println("Base 5, Exponent 3: " + raiseToPower(5,3));

       System.out.println("Base 2, Exponent 7: " + raiseToPower(2,7));

       System.out.println("Base 5, Exponent 9: " + raiseToPower(5,9));

   }

   public static int raiseToPower(int base, int exponent) {

       if (exponent == 0) {

           return 1;

       } else if (exponent == 1) {

           return base;

       } else {

           return (base * raiseToPower(base, exponent-1));

       }

   }

 

}

4 0
3 years ago
In three to four sentences, describe why CEOs (the chief executive officers, that is, the leaders of large companies) make very
mixer [17]
Well, CEOs are on the top of the food chain. It takes a lot of work and ambition to become one, and once they are one, <span>CEOs accept a huge amount of responsibility - that means having to take blame if things go wrong and </span><span>having more tasks to complete such as having to attend numerous meetings, make decisions. They are also on the board of directors.</span>

Assistants do not have to do as much, they likely won't have that much responsibility or experience, their tasks revolve around ensuring meetings are scheduled and performing other ad-hoc duties.
5 0
3 years ago
Other questions:
  • What will be the biased exponent of 1,100.1? <br> A:130<br> B:127<br> C:-127<br> D:2^3
    12·2 answers
  • Which of the following can be both an input device and an output device? mouse. keyboard. display screen. laser printer .
    9·1 answer
  • Broker Ray is closely acquainted with the Subdivision Heights neighborhood of his town. Over the year, Ray has made it a practic
    7·1 answer
  • .All of the following are true with the respect to implicitinvocation except:
    8·1 answer
  • Why it is so important for all application builders to always check data received from unknown sources, such as web applications
    5·1 answer
  • In addition to ranking the relevance of a particular site according to the keywords entered by the user, which of the following
    10·1 answer
  • Coding with Loops Worksheet
    13·2 answers
  • Select all correct statements below: Group of answer choices A redundant link's switch port will be blocked by STP until needed.
    6·1 answer
  • UPS or FedEx plays what role in the supply?
    9·1 answer
  • Artificial intelligence (AI) and machine learning are especially important during which security information and event managemen
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!