Predict the output of the following nested loops:
```
int n = 1;
while(n <= 10)
{
int m = 10;
while(m>=1)
{
cout << n << “ times “ << m
<< “ = “ << n*m << endl;
m--;
}
n++;
}
```
The output is a multiplication table
1 times 10 = 10 1 times 9 = 9 . . .
1 times 1 = 1 2 times 10 = 20 . . .
2 times 1 = 2 3 times 10 = 30 . . .
3 times 1 = 3 4 times 10 = 40 4 times 9 = 36 . . .
4 times 2 = 8 4 times 1 = 4 . . .
9 times 10 = 90
. . .
9 times 1 = 9 10 times 10 = 100 . . .
10 times 1 = 10
You might also like to view...
The statement cout << setw(4) << num4 << " ";
A) outputs the value of num4 rounded to 4 decimal places. B) outputs "stew(4)" before the value in the variable numb. C) outputs the first 4 digits of the number stored in numb. D) outputs the value stored in numb four times. E) does none of above.
After importing data into a new or existing table, a field’s data type can be changed to AutoNumber.
Answer the following statement true (T) or false (F)
By default JScrollPane ________.
a. always displays scrollbars b. never displays scrollbars c. only displays scrollbars if they are needed d. None of the above
A class with no abstract methods is called a
(a) concrete class (b) encapsulated class (c) abstract class (d) private class