Describe the output produced by this poorly indented program segment:
int number = 4;
double alpha = -1.0;
if (number > 0)
if (alpha > 0)
cout << "Here I am!" << endl;
else
cout << "No, I’m here!" << endl;
cout << "No, actually, I’m here!" << endl;
Ans:
since number = 4 is greater than 0, first if is executed.
alpha = -1 is not greter than 0, so, it prints "No, I'm here!"
And finally last line is not under any if statement. so, it will print "No, actually, I'm here"
Output:
---------
No, I'm here!
No, actually, I'm here
You might also like to view...
____ controls the transfer of Web pages over the Internet.
A. SMTP B. FTP C. HTML D. HTTP
What kinds of things are considered under the hardware requirements for an Oracle database?
What will be an ideal response?
Blocking I/O requests to optimize access times increases the number of physical I/O requests.
Answer the following statement true (T) or false (F)
What will be the output of the following lines?
Dim alphabet, soup As String alphabet = "abcdefghijklmnopqrstuvwxyz" soup = alphabet.ToUpper txtBox.Text = alphabet.Substring(0, 5) & soup.Substring(0, 5) (A) abcdeABCDE (B) ABCDEABCDE (C) eE (D) EE