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 runtime error on vector v.
B. The program has a runtime error on v[0], because the vector is empty.
C. The program has a syntax error on vector v.
D. The program has a syntax error on v[0].


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

Computer Science & Information Technology

You might also like to view...

Write a computer program to create a small-world network topology with one gateway router. Add k LLs, where k ? 5, by varying the ? parameter. Find out the impact of different values of ? in the G-APL obtained. Plot a graph for the G-APL and ?.

What will be an ideal response?

Computer Science & Information Technology

Assume you have opened and connected stream variables fileIn and fileOut. Assume further that you have finished with the input and output files. Write the statements necessary to close these files.

What will be an ideal response?

Computer Science & Information Technology

Microsoft Office applications can use ____, a Microsoft product for saving files in the cloud.?

A. ?OneDrive B. ?Backstage C. ?Dock D. ?Time Machine

Computer Science & Information Technology

How would you define third normal form? How do you convert a 2NF design to 3NF? In your answer, refer to specific pages and figures in this chapter.

What will be an ideal response?

Computer Science & Information Technology