Last Updated : 10 Apr, 2024

Choose the correct option from given below to declare vector:

  1. vector <int> vec (10);
  2. vector vec<> (10);
  3. vector <int> (10);

(A) 1
(B) 2
(C) 1 and 3
(D) None of the mentioned


Answer: (A)

Explanation:
The syntax for declaring the vector element is vector variable_name (number_of_elements);


Share your thoughts in the comments