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
Which of the following conditions will maximize the amount of interest you earn
choli [55]
The answer is the amount of money you put in it, brainliest please.
4 0
3 years ago
Which education and qualifications are most helpful for Law Enforcement Services careers? Check all that apply.
bixtya [17]

Explanation:

For IAS..we need a high amptual amount of knowledge..

For IPS..we need master degree and physical fitness too..

For An Advocate..we need Master degree and social Skills..

so..the education and qualifications depends on the various jobs..

HOPE THE ANSWER IS USEFUL

3 0
3 years ago
What are the different types of application architecture
ivann1987 [24]

Answer: There are many different types of application architectures, but the most prominent today, based on the relationships between the services are: monoliths and N-tier architecture, microservices, and event-driven architecture and service-oriented architecture.

Explanation: A layered or N-tier architecture is a traditional architecture often used to build on-premise and enterprise apps, and is frequently associated with legacy apps.

A monolith, another architecture type associated with legacy systems, is a single application stack that contains all functionality within that 1 application. This is tightly coupled, both in the interaction between the services and how they are developed and delivered.

Microservices are both an architecture and an approach to writing software. With microservices, apps are broken down into their smallest components, independent from each other. Each of these components, or processes, is a microservice.

With an event-driven system, the capture, communication, processing, and persistence of events are the core structure of the solution. This differs from a traditional request-driven model.

The service-oriented architecture (SOA) is a well-established style of software design, that is similar to the microservices architecture style.

3 0
2 years ago
Write a program that asks a user to enter a date in month day year format (for example 10 12 2016) and displays the day of the w
AleksAgata [21]

Answer and Explanation:

Using javascript:

function dayof_theweek(){

var TodayDate = window. prompt("enter today's date in the format 'year, month, day' ");

var Datenow=new date(TodayDate);

var Dayofweek=Datenow.getday();

var Days=["monday","Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"];

if(Dayofweek==indexOf(Days[Dayofweek]))

{

document.createTextnode(Days[Dayofweek]);

}

}

The program above uses a date object which uses the method getday to get the day of the week(get day returns an integer from 0 to 6).we then use a comparison operator == to test the condition that returned value Dayoftheweek is same with the index of the array Days and then print to a html document. The program may need improvements such as the fact that errors may arise when proper input isn't given, and therefore must be handled.

8 0
2 years ago
What are the values of the following expressions? In each line assume that,
MissTica

Answer:

double x = 2.5;

double y = -1.5;

int m = 18;

int n = 4;

string s = "Storm";

string t = "Watch";

The output of the expression "x + n*y - (x+n)*y" is "6.25".

and the output of expression "m/n + m%n" is "6".

Explanation:

for the first expression,

x + n*y - (x+n)*y ,put value of every variables in it.

=2.5+4*(-1.5)-(2.5+4)*(-1.5)

=2.5-6.0-(6.5*(-1.5)

=-3.5+9.75

=6.25

for the second expression,

m/n + m%n,  put value of every variables in it.

=18/4 +18%4

=4+2      ("/ will give quotient and % will give remainder")

=6

4 0
3 years ago
Other questions:
  • PLS HELP ASAP! WILL GIVE BRAINLIEST!
    14·1 answer
  • Write a brief one parapragh summary describing the financial reality of the American family.
    10·1 answer
  • What kind of information B2B SaaS companies wish to know about their competition, apart from information about their competitors
    15·1 answer
  • A graph of an organization'snet income over the past 10 years is an example of an analogmodel.
    7·1 answer
  • Aspiring graphic designers can earn a(n) certification for graphic design software, such as Photoshop and Acrobat.
    9·2 answers
  • If you want to insert a table which ribbon should you select
    13·2 answers
  • The most important hardware device for connecting supercomputers over a wide area
    10·1 answer
  • Describe all the steps a router goes through while deciding where to send the a packet. Explain why a router would choose one ro
    7·1 answer
  • Gus has decided to organize his inbox on June 26 by using folders and deleting irrelevant messages. He creates a folder called "
    12·2 answers
  • YASHARI earns $27,000 per year, is single, and lives in Wyoming. She has $7000 in Direct Subsidized loans and another $19,000 in
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!