x = 10 y = 20
First value = 10 Second value = 20
void stl_q10_pair() {
pair<string, int> student = make_pair("Raj", 20);
cout << "Name: " << student.first << endl;
cout << "Age: " << student.second << endl;
// Vector of pairs
vector<pair<string, int>> students;
students.push_back(make_pair("Priya", 22));
students.push_back(make_pair("Amit", 21));
for(auto s : students) {
cout << s.first << " - " << s.second << endl;
}
}
void stl_q10_pair() {
pair<string, int> student = make_pair("Raj", 20);
cout << "Name: " << student.first << endl;
cout << "Age: " << student.second << endl;
// Vector of pairs
vector<pair<string, int>> students;
students.push_back(make_pair("Priya", 22));
students.push_back(make_pair("Amit", 21));
for(auto s : students) {
cout << s.first << " - " << s.second << endl;
}
}