Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

vectors in c++

#include <iostream>
#include <vector>
using namespace std;
int main(){
  vector<int> v1 ={1,2,3,4,5};
 
  vector<int> v2{1,2,3,4};
  
  vector<int> v3(4,11);
  
  cout << "vector1" <<" ";
  
  for(int i:v1){
	cout << i << " "; 
  }
  
   for(int i:v1){
	cout << i << " "; 
  }
  
   for(int i:v1){
	cout << i << " "; 
  }
}
Source by www.geekforgeeks.org #
 
PREVIOUS NEXT
Tagged: #vectors
ADD COMMENT
Topic
Name
9+9 =