-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtutorial2.cpp
More file actions
28 lines (27 loc) · 977 Bytes
/
tutorial2.cpp
File metadata and controls
28 lines (27 loc) · 977 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
#include <iostream>
#include <vector>
using namespace std;
int main()
{
// 1.Create a vector of integers vec1 with 5,4,3,2,1
// 2a.Print the content of the vector on screen
// 2b.Print the content in the reverse order.
// 2c. Print 3rd element on the screen
// 2d. Change the content of the 4th element to 100
// 3.Add elements 5,6,7,8,5 to the end of the vector push_back()
// 4.Print the first and the last of the element front(), back()
// 5.Print the size of the vector
// 6.Find the smallest element min_element()
// 7.Find the largest element max_element()
// 8.Count number of appearence of 5
// 9.Sort the vector
// 10.Print its content on the screen
// 11.Create another vector vec2
// 12.Check if it is empty
// 13.Add 20, 22 to second vector
// 14.Insert 23 in-between 20 and 23.
// 15.copy first 5 elements from vec1 into vec3
// 16.Remove all elements from the vec3
// 17.Remove elements from 3 to 5 in vec1
return 0;
}