Transform the following while loop into an equivalent do loop (make sure it produces the same output).

```
int num = 1;
while (num < 20)
{
num++;
System.out.println(num);
}

```

This code can be written using a do loop as follows:
```
int num = 1;
do
{
num++;
System.out.println(num);
}
while (num < 20);

```

Computer Science & Information Technology

You might also like to view...

IBM's DB2 program contains a hybrid XML/relational database server.

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

Computer Science & Information Technology

Which of the following is the most dangerous because it can do more on a computer when it is executed?

A. VBscript B. Active-X C. Javascript D. Java

Computer Science & Information Technology