Code:

#include<stdio.h>
void mergesort(int*,int,int);
void merge(int*,int,int,int);
void checker_exe3(int*,int*,int,int);
void arr_mehaber(int*,int*,int*);
void mymerge(int*,int*,int*,int);
#define A 5
#define B 7
void main()
{
int a[A]={1,1,1,1,1},low=0,high,i,p=0,k=0;
int b[B]={1,1,1,1,1,1,1};
int c[A]={0};
mergesort(a,low,A);
mergesort(b,low,B);
mymerge(a,b,c,k);
for(i=1;i<k;i++)
{
printf("%d\n",c[i]);
}
printf("\n");
return 0;
}
void mergesort(int arr[], int low, int high)
{
int mid;
if(low<high)
{
mid=(low+high)/2;
mergesort(arr,low,mid);
mergesort(arr,mid+1,high);
merge(arr,low,high,mid);
}
}
void merge(int arr[], int low, int high, int mid)
{
int i, j, k, c[50];
i=low;
j=mid+1;
k=low;
while((i<=mid) && (j<=high))
{
if(arr[i] < arr[j])
{
c[k]=arr[i];
k++;
i++;
}
else
{
c[k]=arr[j];
k++;
j++;
}
}
while(i <= mid)
{
c[k]=arr[i];
k++;
i++;
}
while(j <= high)
{
c[k]=arr[j];
k++;
j++;
}
for(i=low; i<k; i++)
arr[i]=c[i];
}
void checker_exe3(int arr[],int res[],int high,int p)
{
int i;
printf("%d\n",high);
for(i=1; i<high; i++)
{
if(arr[i-1] == arr[i])
{
res[i-1]=arr[i];
p++;
i++;
}
}
}
void arr_mehaber(int a[],int b[],int arr[])
{
int i;
for(i=0; i<A; i++)
arr[i]=a[i];
for(i=0; i<B; i++)
arr[A+i]=b[i];
for(i=0;i<(A+B);i++)
printf("%d,",arr[i]);
printf("\n");
}
void mymerge(int a[],int b[],int c[],int k)
{
int i=0,j=0;
while((i<=A) || (j<=B))
{
if(a[i] == b[j])
{
c[k]=a[i];
i++;
j++;
k++;
}
if(a[i]>b[j])
j++;
if(a[i]<b[j])
i++;
}
for(i=1;i<k;i++)
printf("%d ", c[i] );
printf("\n");
}

I would be very grateful if someone would explain me my mistake