Write a program Given three arrays A[n], B[n] & C[n] containing bit strings representing sets A, B & C respectively, write a code fragment to determine whether (𝐴 ∩ 𝐵) ⊂ 𝐶.
#include<bits/stdc++.h>
using namespace std;
int main()
{
char a[5] = {'0','1','1','0','1'};
char b[5] = {'1','0','1','1','0'};
int c;
cout<<"\nBit String A[n] = ";
for(a=0;c<5;c++)
{
cout<<A[c]<<", ";
}
cout<<"\nBit String B[n] = ";
for(a=0;c<5;c++)
{
cout<<B[c]<<", ";
}
cout<<"\n\nCombined Bit String A[n] + B[n] = ";
for(c=0;c<5;c++)
{
cout<<A[c]<<", ";
}
for(c=0;c<5;c++)
{
out<<B[c]<<", ";
}
return(0);
}
Comments
Leave a comment