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
Given that add, a function that expects two integer parameters and returns their sum, and given that two variables, euro_sales a
Evgesh-ka [11]

Answer:

int eurasia_sales = add(euro_sales,asia_sales);

Explanation:

Kindly find the explanation attached

Download txt
7 0
4 years ago
Sarah is creating and formatting a newsletter for her school. Which page layout rules should she consider when doing this?
lorasvet [3.4K]
Hey!

I believe the answer to 1. Should be A. Rule of Thirds.
6 0
4 years ago
Read 2 more answers
How does a hard drive work?
BigorU [14]

a hard drive is a metal disk constantly spinning  while powered on.

The data is written with a  metal scratching the data onto the wheel.

8 0
3 years ago
a(n) ___ loop allows you to cycle through an array without specifying the starting and ending points for the loop
Arte-miy333 [17]

Answer:

enhanced for loop

Explanation:

Enhanced for loop is an improve concept about loops, this features was implemented in Java SE 5.0 version, this method simplify the For structure. For example:

for (int i = 0; i <array.length; i ++) {  

   System.out.print (array [i]);  

}

Enhanced for loop

for (String element : array) {

   System.out.print(element);

}

8 0
3 years ago
Give an example of an outdated memory or storage device what do you think they are outdated
andreev551 [17]

Answer:

HDD technology

Explanation:

You will find that there is a big difference between the SSD and the HDD. The SSD lists out the technical advantages as well as the disadvantages related to HDD, and this has led to the wide use of the SSD rather than the HDD, which is supposed by many being an outdated product. You will find that the SSDs last longer, and they are faster. However, the SSD is more prone to damages as compared to HDD. However, SSD looks like being more advanced considering the above-mentioned advantages, and fewer number of disadvantages. And hence, many people shifted to the SSD from HDD. Remember, SSD stands for solid state drives. And HDD means hard disk drive.

8 0
3 years ago
Other questions:
  • WILL GIVE BRAINLIEST! A rent payment is an example of which type of expense?
    14·2 answers
  • What is the opportunity cost of computers when moving from point A to point B? -15 DVDs b. What is the opportunity cost of compu
    13·1 answer
  • What is AI and its necessary types?
    6·1 answer
  • blank affect your vision because your eye muscles are tired along with the rest of your body and is difficult to focus
    11·2 answers
  • In Java Write a program that prompts the user for a name (any String value would work for testing), and print a hello message to
    15·1 answer
  • What are the best data structures to create the following items? And why?
    13·1 answer
  • Testing for information would be most likely to occur in which type of engineering?
    5·2 answers
  • In the Microsoft Excel spreadsheet how many choices are possible when using a single IF statement​
    9·1 answer
  • What is wrong with the following code?
    11·1 answer
  • How to change the microsoft word pages to black background
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!