1int v[] = {1,2,3,4,5};
2for (int n : v)
3 cout << n << endl;
4//make sure to compile with -std=c++11
1//inserting array elements in cpp
2#include<iostream>
3using namespace std;
4int main()
5{
6 int arr[100];//you can give any data type and any array size you want
7 for(int i=0;i<100;i++)
8 {
9 cin>>arr[i];
10 }
11 return 0;
12}