Challenge

Project 1 - Creation of user defined data type to implement the user interfaces for working with ‘Set’ (Mathematical Set theory)

include<stdio.h>
int i,j;
struct set//structure create 
{
int arr_1[20]
int arr_2[20]
int arr_3[20]
};

int main()
{
struct set list;//create object
printf("no of element in the lidt 1 is;");
scanf("%d",&i);
for(int n=0;<i;n++)//get the value 1
{
int=n+i
print f ("n enter the %d element;"j);
scanf(%d,&list.arr_1[n]);
}
printf("n NO of element in the list 2 is;");
scanf("%d",&j);
for(intn=0,n<j;n++)//get the value 2
{
int=j=n+1;
printf("n enter the %d element;"j);
scanf("%d",&list arr_2[n]);
}
int array[20];
intf=start(listarr_1,list.arr_2,&array);
for(inti=0;i<f;++)//array conveter
{
list.arr_3[i]=array[i];
}
for(inti=0;i<f;++)
{
printf{"output list%dn",list.arr_3[i]);//print the output
}

}
int start(int arr1[],int arr2[],int*ptr)
{
int flag=0;
intf=0;
for(intn=0;n<i,n++)//check the first array
{
for(intm=0;m<j;m++)
{
if(check(arr1[n],arr2[m]))//condition checking
{
flag=1;
}
else
{
flag=0;
break;
}
}
if(flag==1)
{
*ptr==arr1[n];//set the value
f++;
ptr++;
}
}
for(intn=0;n<j;n++)//check the second array
{
for(intm=0;m<i;m++)
{
if((check(arr2[n],arr1[m]))==1)//condition checking
{
flag=1;
}
else
{
flag=0;
break;
}
}
if(flag==1)//set the value 
{
*ptr=arr2[n];
f++;
ptr++;
}
}
return f;
}
int check(int*num1,int*num2)//function detection
{
if9num==num2)
return0;
else
return 1;
}
Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.