November 2001
Beginner
1128 pages
29h 12m
English
| 1: | What's the difference between an entry-condition loop and an exit-condition loop? Which kind is each of the C++ loops? |
| 2: | What would the following code fragment print if it were part of a valid program?
int i;
for (i = 0; i < 5; i++)
cout << i;
cout << "\n";
|
| 3: | What would the following code fragment print if it were part of a valid program?
int j;
for (j = 0; j < 11; j += 3)
cout << j;
cout << "\n" << j << "\n";
|
| 4: | What would the following code fragment print if it were part of a valid program?
int j = 5;
while ( ++j < 9)
cout << j++ << "\n";
|
| 5: | What would the following code fragment print if it were part of a valid program?
int k = 8;
do
cout <<" k = " << k << "\n";
while (k++ < 5);
|
| 6: | Write a for loop that prints the values ... |
Read now
Unlock full access