What is wrong in the following code?

```
vector v;
v[0] = 2.5;
```
a. The program has a runtime error because you cannot assign a double value to v[0].
b. The program has a runtime error because there are no elements in the vector.
c. The program has a compile error because there are no elements in the vector.
d. The program has a compile error because you cannot assign a double value to v[0].


b. The program has a runtime error because there are no elements in the vector.

Computer Science & Information Technology

You might also like to view...

What are the rules for Intersecting Alphabetized Lists? How are they used to implement search queries?

What will be an ideal response?

Computer Science & Information Technology

A ________ attitude goes beyond just a positive attitude and includes a sense ofcaring for the customer

a. Happy b. Service c. Knowledgeable d. None of the above

Computer Science & Information Technology

Which of the following does the OSPF routing protocol use to verify that a link between to routers is active and the routers are communicating?

A) "Hello" packets B) ARP messages C) LSAs D) Ping

Computer Science & Information Technology

List the advantages of the PureFTPd Server.

What will be an ideal response?

Computer Science & Information Technology