Given the following code segment, what is the output?

int x = 1, y = 1, z = 1;
y = y + z;
x = x + y;
cout << "result = " << (x < y ? y : x) << endl;

a. result = 0
b. result = 1
c. result = 2
d. result = 3
e. there will be no output

d. result = 3

Computer Science & Information Technology

You might also like to view...

What is not an advantage of cloud storage?

A) It is very fast. B) It can be access anywhere you have an Internet connection. C) It makes file sharing easier. D) It often keeps multiple revisions of a document.

Computer Science & Information Technology

Case-Based Critical Thinking Questions ? Case 1-1 Lucy wants to develop a web page to display her profile. She wants to just start with a basic page that lists her accomplishments, her work history, and the different computer courses she has taken. She would like each section to be clearly identified. ? Where will Lucy's information page be stored once she has created it?

A. ?on a web page B. ?on a network driver C. ?on a web server D. ?on the World Wide Web Consortium (W3C)

Computer Science & Information Technology