What is the output from each of the following loops?

a) while ( 0 )
cout << ‘X’;
cout << endl;
b) do
cout << ‘X’;
while ( y != y );
cout << endl;
c) int i = 1;
while (i < 9) cout i;
i++;
}
cout << endl;
d) char c = 'A';
do
{
cout << c << " ";
c = c + 2;
} while ( c <= 'M' )
cout << endl;
e) int i = 0;
while (i < 50)
{
if ( i < 20 && i != 15 )
cout << 'X';
i++;
}
cout << endl;


a. The only output is a carriage return.
b. X
c. 12345678
d. A C E G I K M
e. XXXXXXXXXXXXXXXXXXX (There are 19 Xs.)

Computer Science & Information Technology

You might also like to view...

In a JavaFX CSS style definition, if a selector name starts with a period, that selector corresponds to a __________.

a. value entered by the user b. specific JavaFX node c. named color d. specific variable in the application

Computer Science & Information Technology

RAM chips permanently hold data.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

A tweet forwarded to other Twitter users is a ________

A) list B) hashtag C) vine D) retweet

Computer Science & Information Technology

The expression =Date(), inserted in a text box in a report design, will return the ____________________ value.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology