## Compatible Arrays

2 arrays are said to be compatible if they are of the same size and if the ith element in the first array is greater than or equal to the ith element in the second array for all i.

## Write a  program to find whether 2 arrays are compatible or not.

Input Format:

Input consists of 2n+1 integers. The first integer corresponds to ‘n’ , the size of the array. The next ‘n’ integers correspond to the elements in the first array. The last ‘n’ integers correspond to the elements in the second array. Assume that the maximum value of n is 15.

Output Format:

Refer sample output for details.

Sample Input 1:

5

2

3

6

8

1

1

1

1

1

1

Sample Output 1:

Compatible

Sample Input 2:

5

2

3

6

8

1

1

1

1

1

2

Sample Output 2:

Incompatible

code:

```#include<stdio.h>
int main()

{

int n,a[15],b[15],i,c=0;

scanf("%d",&n);

for(i=0;i<2*n;i++)
{if(i<n)scanf("%d",&a[i]);
else
{
scanf("%d",&b[i-n]);
if(c==0)if(a[i-n]<b[i-n])c=1;
}
}
if(c==0)printf("Compatible");
else
printf("Incompatible");
return 0;
}```

## Compatible Arrays Using Functions in C

```#include <stdio.h>
{
int i =0;

printf("\nEnter elements : \n");

for(i=0; i < size; i++)
{
printf("Enter arr[%d] : ",i);
scanf("%d",&arr[i]);
}
}

void printArray(int arr[],int size) //printing
{
int i =0;

printf("\nElements are : ");

for(i=0; i < size; i++)
{
printf("\n\tarr[%d] : %d",i,arr[i]);
}
printf("\n");
}

char compareArray(int a[],int b[],int size)//comparing
{
int i;
for(i=0;i<size;i++){
if(a[i]!=b[i])
return 1;
}
return 0;
}

int main(){
int a[5],b[5];