Author Question: What will the following C++11 code display? vector numbers {3, 5};for (int val : numbers) cout (Read 193 times)

kaid0807

  • Hero Member
  • *****
  • Posts: 515
What will the following C++11 code display?
vector numbers {3, 5};
for (int val : numbers)
    cout << val << endl;

3
3
3
3
3

5
5
5

3
5

◦ Nothing. This code has an error.



Related Topics

Need homework help now?

Ask unlimited questions for free

Ask a Question


 

Did you know?

The top five reasons that children stay home from school are as follows: colds, stomach flu (gastroenteritis), ear infection (otitis media), pink eye (conjunctivitis), and sore throat.

Did you know?

As of mid-2016, 18.2 million people were receiving advanced retroviral therapy (ART) worldwide. This represents between 43–50% of the 34–39.8 million people living with HIV.

Did you know?

Colchicine is a highly poisonous alkaloid originally extracted from a type of saffron plant that is used mainly to treat gout.

Did you know?

You should not take more than 1,000 mg of vitamin E per day. Doses above this amount increase the risk of bleeding problems that can lead to a stroke.

Did you know?

Eating food that has been cooked with poppy seeds may cause you to fail a drug screening test, because the seeds contain enough opiate alkaloids to register as a positive.

For a complete list of videos, visit our video library