#include<stdio.h>
int count;
void create(float seta[],int n1,float tempa[] );
int main()
{ int i;
float *seta; float *setb; float *tempa; int n1,n2;
printf("enter the elements of set 1:\n");
printf("enter the number of elements in set 1:\n");
scanf("%d",&n1);
seta=(float*)malloc(n1*sizeof(float));
for(i=0;i<n1;i++)
{
scanf("%f",seta+i);
}
printf("enter the elements of set 2:\n");
printf("enter the number of elements in set 2:\n");
scanf("%d",&n2);
setb=(float*)malloc(n2*sizeof(float));
for(i=0;i<n2;i++)
{
scanf("%f",setb+i);
}
create(seta,n1,tempa);
for(i=0;i<count;i++)
printf("%d",*(tempa+i));
return 0;
}
void create(float a[20],int n1,float tempa[20])
{int count=1,i,j,countverify;a[0]=tempa[0];
for(i=0;i<n1;i++)
{countverify=0; for(j=0;j<count;j++)
if(tempa[j]!=a[i]) {countverify++;}
if(countverify==count)
{
tempa[count]=a[i]; count++; }
}
} /*the set b can be removed if you want.it has been declared to do furthur set opwrations at later stages but first let me know what the error is .my compiler stopped after scanning the elements*/