Documente Academic
Documente Profesional
Documente Cultură
}
cout<<"enter no of who play badminton";
cin>>bi;
for(i=0;i<bi;i++)
{
cin>>b[i];
in(crk,b);
un(crk,b);
cricket(crk,b);
badminton(b,crk);
nor(cl,crk,b);
return 0;
}
void in(int a[10],int b[10])
{
int i,j;
cout<<"intersection"<<endl;
for(i=0;i<c;i++)
{
for(j=0;j<bi;j++)
{
if(a[i]==b[j])
{
cout<<a[i]<<endl;
}
}
}
void un(int a[10],int b[10])
{
int i,j,temp=0;
cout<<"union"<<endl;
for(i=0;i<c;i++)
{
for(j=0;j<bi;j++)
{
if(a[i]==b[i])
{
temp=1;
}
}
if(temp==0)
{
cout<<a[i]<<endl;
}
temp=0;
}
for(j=0;j<bi;j++)
{
cout<<b[j]<<endl;
}
}
}
if(temp==0)
{
cout<<ci[i]<<endl;
}
temp=0;
}
}
void badminton(int ci[10],int b[10])
{
int i,j,temp=0;
cout<<"only badminton"<<endl;
for(i=0;i<c;i++)
{
for(j=0;j<bi;j++)
{
if(ci[i]==b[j])
{
temp=1;
}
}
if(temp==0)
{
cout<<ci[i]<<endl;
}
temp=0;
}
}
void nor(int a[10],int b[10],int ci[10])
{
int i,j,k,temp=0;
cout<<"who dont play anything"<<endl;
for(i=0;i<m;i++)
{
for(j=0;j<c;j++)
{
for(k=0;k<bi;k++)
{
if(a[i]==b[j])
{
temp=1;
}
if(a[i]==ci[k])
{
temp=1;
}
}
}
if(temp==0)
{
cout<<a[i]<<endl;
}
temp=0;
}
}