Take a screenshot of your output.
Take a screenshot of your output.
write a C++ functions to compute following (Set Theory)
#include <iostream>
#include <
using namespace std;
struct rpair {
int a;
int b;
};
void print(std::vector<struct rpair>& R) {
for (auto e: R) {
cout<<e.a <<" " << e.b <<endl;
}
}
std::vector<int> composition(std::vector<struct rpair>& R, std::vector<struct rpair>& S)
{
}
std::vector<struct rpair> cartesian_product(std::vector<int>& a, std::vector<int>& b) {
}
int main()
{
//struct rpair x = {10,20};
int x = 128;
printf("%c\n", x);
std::vector<struct rpair> R = {{1, 2}, {1, 6}, {2, 4}, {3, 4}, {3, 6}, {3, 8}};
std::vector<struct rpair> S = {{2, 'u'}, {4, 's'}, {4, 't'}, {6, 't'}, {8, 'u'}};
print(R);
return 0;
}
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images