forked from tanmayhinge-zz/competitive-programming-workshop
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharray.cpp
More file actions
28 lines (20 loc) · 625 Bytes
/
array.cpp
File metadata and controls
28 lines (20 loc) · 625 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// The array header file is part of STL which provides
// a lot of array operations such as array.size()
// which calculates the number of elements present in
// the array, such function is not available directly in C.
#include<iostream>
#include<array>
using namespace std;
int main()
{
// Initializing the array elements
array<int,6> ar = {1, 2, 3, 4, 5, 6};
// Printing first element of array
cout << "First element of array is : ";
cout << ar.front() << endl;
// Printing last element of array
cout << "Last element of array is : ";
cout << ar.back() << endl;
// try to output an array
return 0;
}