diff --git a/Pairs/Nestedpair.cpp b/Pairs/Nestedpair.cpp new file mode 100644 index 0000000..325e758 --- /dev/null +++ b/Pairs/Nestedpair.cpp @@ -0,0 +1,17 @@ +#include +using namespace std; +void printpairs(pair> p) +{ + cout + << p.first << endl + << p.second.first << endl + << p.second.second; +} +int main() +{ + pair> p; + cout << "enter a pair value"; + cin >> p.first >> p.second.first >> p.second.second; + printpairs(p); + return 0; +} \ No newline at end of file diff --git a/Pairs/Nestedpair.exe b/Pairs/Nestedpair.exe new file mode 100644 index 0000000..836414d Binary files /dev/null and b/Pairs/Nestedpair.exe differ diff --git a/Pairs/pairarray.cpp b/Pairs/pairarray.cpp new file mode 100644 index 0000000..7c85972 --- /dev/null +++ b/Pairs/pairarray.cpp @@ -0,0 +1,14 @@ +#include +using namespace std; +void printpairs(pair p[]) +{ + cout << p[1].first << endl + << p[1].second; +} +int main() +{ + pair p[4] = {{1, 2}, {3, 4}, {4, 5}, {6, 7}}; + + printpairs(p); + return 0; +} \ No newline at end of file diff --git a/Pairs/pairarray.exe b/Pairs/pairarray.exe new file mode 100644 index 0000000..aafe55b Binary files /dev/null and b/Pairs/pairarray.exe differ diff --git a/Pairs/pairs.cpp b/Pairs/pairs.cpp new file mode 100644 index 0000000..b822f1b --- /dev/null +++ b/Pairs/pairs.cpp @@ -0,0 +1,13 @@ +#include +using namespace std; +void printpairs() +{ + pair p = {1, 3}; + cout << p.first << endl + << p.second; +} +int main() +{ + printpairs(); + return 0; +} \ No newline at end of file diff --git a/Pairs/pairs.exe b/Pairs/pairs.exe new file mode 100644 index 0000000..a2c630c Binary files /dev/null and b/Pairs/pairs.exe differ diff --git a/Pairs/userinppair.cpp b/Pairs/userinppair.cpp new file mode 100644 index 0000000..b50fd40 --- /dev/null +++ b/Pairs/userinppair.cpp @@ -0,0 +1,15 @@ +#include +using namespace std; +void printpairs(pair p) +{ + cout << p.first << endl + << p.second; +} +int main() +{ + pair p; + cout << "enter a pair value"; + cin >> p.first >> p.second; + printpairs(p); + return 0; +} \ No newline at end of file diff --git a/Pairs/userinppair.exe b/Pairs/userinppair.exe new file mode 100644 index 0000000..32eee28 Binary files /dev/null and b/Pairs/userinppair.exe differ