What is wrong in the following code?

```
#include
#include
using namespace std;

int main()
{
vector v;
cout << v[0];
return 0;
}
```
a. The program has a compile error on v[0].
b. The program has a compile error on vector v.
c. The program has a runtime error on vector v.
d. The program has a runtime error on v[0], because the vector is empty.
Key:d


d. The program has a runtime error on v[0], because the vector is empty.

Computer Science & Information Technology

You might also like to view...

What is the output of the following program fragment?

cout << static_cast(3/4) << endl; a. 3 b. 0.5 c. 0.0 d. 0.75

Computer Science & Information Technology

All reviewer's revisions and comments display in the color blue

Indicate whether the statement is true or false

Computer Science & Information Technology

If you want to apply more than one attribute to a Web page (such as a particular font), you could create a tag such asĀ  ____.

A. B. C. D.

Computer Science & Information Technology

The only time it is necessary to check links to make sure they work is just before publishing your website but only when you have completed all other tasks.

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

Computer Science & Information Technology