#include<stdio.h>
#include<conio.h>
void Union(int set1[10],int set2[10],int m,int n);
void Intersection(int set1[10],int set2[10],int m,int n);
void main()
{
{
int a[10],b[10],m,n,i,j;
int ch;
clrscr();
printf("\nEnter the no of elements in first set:");
scanf("%d",&m);
printf("\nEnter the elements:");
for(i=0;i<m;i++)
{
scanf("%d",&a[i]);
}
printf("\nElement of First set:\n");
for(i=0;i<m;i++)
{
printf("\t%d",a[i]);
}
printf("\nEnter the no of elements in second set:");
scanf("%d",&n);
printf("\nEnter the elements:");
for(i=0;i<n;i++)
{
scanf("%d",&b[i]);
}
printf("\nElement of second set\n");
for(i=0;i<n;i++)
{
printf("\t%d",b[i]);
}
while(1)
{
printf("\n\tMenu\n\n1.Union\n2.Intersection");
printf("\n3.exit");
printf("\nenter your choice:-");
scanf("%d",&ch);
switch(ch)
case 1:
union(a,b,m,n);
break;
case 2:
intersection(a,b,m,n);
break;
case 3:
exit(0);
}
getch();
}
}
void union(int a[10],int b[10],int m,int n)
{
int c[20],i,j,k=0,flag=0;
for(i=0;i<m;i++)
{
c[k]=a[i];
k++;
}
for(i=0;i<n;i++)
{
flag=0;
for(j=0;j<m;j++)
{
if(b[i]==c[j])
{
flag=1;
break;
}
}
if(flag==0)
{
c[k]=b[i];
k++;
}
}
printf("\nElement of resultant set\n");
for(i=0;i<k;i++)
{
printf("\t%d",c[i]);
}
}
void intersection(int a[10],int b[10],int m,int n)
{
int c[20],i,j,k=0,flag=0;
for(i=0;i<m;i++)
{
flag=0;
for(j=0;j<n;j++)
{
if(a[i]==b[j])
{
flag=1;
break;
}
}
if(flag==1)
{
c[k]=a[i];
k++;
}
}
printf("\nElement of resultant set\n");
for(i=0;i<k;i++)
{
printf("\t%d",c[i]);
}
}
#include
#include
void main()
{
int i,k=0,x[10],y[10],c[25],j,n,n1,d[25],f=0;
clrscr();
printf("\n how many elements in SET 1:");
scanf("%d",&n);
for(i=0;i
{
printf("\n please enter the elements no %d",i+1);
scanf("%d",&x[i]);
}
printf("\n how many elements in set 2:");
scanf("%d",&n1);
for(i=0;i
{
printf("\n please enter elements no %d",i+1);
scanf("%d",&y[i]);
}
for(i=0;i
{
c[k]=x[i];
k++;
}
for(i=0;i
{
for(j=0;j
{
if(y[i]==x[j])
break;
}
if(j==n)
{
c[k]=y[i];
k++;
}
}
printf("\n the union set is:{");
for(i=0;i
printf("%d",c[i]);
printf("}\n");
for(j=0;j
{
for(i=0;i
{
if(y[i]==x[j])
break;
}
if(i!=n1)
{
d[f]=y[i];
f++;
}
}
printf("\n the intersection set is :{");
for(i=0;i
printf("%d",d[i]);
printf("}");
getch();
}
write a program to find union and inter section of two array BY: SNDPLN | DATE: APRIL 18, 2011 | CATEGORIES: SOLVEDIFF
/*************************/-P-7-/***************************
NAME:-Nimbalkar Yogesh Dattatraya
Roll No:-452 Class:-F.Y.B.C.A
Program Name:-Wirte a progam to find union & inter section
of two st of integers(store it in tow array)
***********************************************************/
#include
#include
void main()
{
int a[5],b[5],c[10],d[10];
int i,j,k,f,x;
clrscr();
printf("n Enter element of set A=");
for(i=0;i<5;i++)
{
scanf("%d",&a[i]);
}
printf("n Enter element of set B=");
for(i=0;i<5;i++)
{
scanf("%d",&b[i]);
}
for(i=0;i<5;i++)
{
c[i]=a[i];
}
for(k=0;k<5;k++)
{
f=0;
for(j=0;j
{
if(b[k]==c[j])
{
f=1;
break;
}
}
if(f==0)
{
c[i]=b[k];
i++;
}
}
x=0;
for(k=0;k<5;k++)
{
f=0;
for(j=0;j<5;j++)
{
if(a[k]==b[j])
{
f=1;
break;
}
}
if(f==1)
{
d[x]=a[k];
x++;
}
}
printf("n Elements of A Union B={");
for(k=0;k
{
if(k==i-1)
printf("%d",c[k]);
else
printf("%d,",c[k]);
}
printf("}n");
printf("n Elements of A Inter section B={");
for(k=0;k
{
if(k==x-1)
printf("%d",d[k]);
else
printf("%d,",d[k]);
}
printf("}");
getch();
}
****************/-P-7-/************************
Out put:-
************************************************
Enter element of set A=1 2 3 4 5
Enter element of set B=3 4 5 6 7
Elements of A Union B={1,2,3,4,5,6,7}
Elements of A Inter section B={3,4,5}
#include<stdio.h>
you can use strstr()
write a c program to display marks,total,average,grade using union
you can find a sample paper with the brochur. That was the oly guide line we had.
Write an. Algorthim. To. Find the. Sum. Of. First15 natural. Numbers
#include<stdio.h>
you can use strstr()
You can find the intersection of the angle bisectors or the intersection of the perpendicular bisectors of each side.
It would help to know "... the point of intersection of a parallelogram" and what!
write a c program to display marks,total,average,grade using union
You could use an if, but the ternary operator is especially compact for this purpose: result = a > b ? a : b;
another point
www.graffiticreator.net/
if you think that you have uninstall a programme but it is still there in your computer you need check in the programme files where you will see the list of programme .....
Unless the line is a subset of the plane, the intersection is a point.
it is the intersection of the medians of two cords!
tv programme i think