What is the output for the following code segment:

int a = 1;
int b = 5;
if (a + b < 6)
cout << a;
else
cout << b;
cout << a + b;

56

Computer Science & Information Technology

You might also like to view...

If more method calls occur than can have their activation records stored on the program execution stack, an error known as a ________ occurs.

a. stack overflow. b. stack rewind. c. stack full. d. stack empty.

Computer Science & Information Technology

What states are displayed in the list box by the following program segment?

``` Dim states() As String = {"Colorado", "New Mexico", "Arizona", "Utah"} Dim query = From state in states Where ContainsE(state) Select state For Each state in query lstBox.Items.Add(state) Next Function ContainsE(word As String) As Boolean If word.IndexOf("E") <> -1 Or word.IndexOf("e") <> -1 Then Return True Else Return False End If End Function ``` (A) Colorado (B) New Mexico (C) Colorado, New Mexico, Arizona, Utah (D) No states

Computer Science & Information Technology