How many lines of output will be displayed by the following program fragment?

```
i = 0
do {
for (j = 0; j < 4; j = j + 1)
printf("%d\n", i + j);
i = i + 1;
} while (i < 5);
```
a. 0
b. 7
c. 9
d. 16
e. 20

E

Computer Science & Information Technology

You might also like to view...

An administrator is installing a new OS on a brand new server. The administrator cannot bring a monitor or keyboard into the datacenter. Which of the following is the administrator MOST likely to use to configure the OS?

A. Integrated lights out manager B. Remote desktop protocol C. Virtual network computing D. Keyboard - video - mouse

Computer Science & Information Technology

Predict the output and explain your prediction.

The following program has been partitioned into two files. The command line command for compiling this is CC B.cpp A.cpp, where CC is the name for your command line compiler. For VC++ this is CL, for Borland, this is BCC32, and for the GNU C++ compiler, this is g++. If you use an IDE (integrated development environment) you would have to place both these files in your project then click the compile button. ``` // This goes in file A.cpp namespace { int func(int i) { return i*3; } int junk (int i) { return i*func(i); } // This goes in file B.cpp #include int func(int i) { return i*5; } int junk(int i); //from A.cpp int main() { cout <<”func(5) = “ << func(5) << endl; cout <<”junk(5) = “ << junk(5) << endl; } ```

Computer Science & Information Technology