#include<stdio.h>
#include<conio.h>
main()
{
int *a,*b,f,i,j,k=0,n,p,q;
printf("Enter number of elements you want in your array:");
scanf("%d",&n);
a=(int *)malloc(n*sizeof(int));
b=(int *)malloc(n*sizeof(int));
printf("\nEnter the elements in array:\n");
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
if(a[i]<=25)
{
b[k]=a[i];
k++;
}
}
b=(int*)realloc(b,k*sizeof(int));
for(i=0;i<k;i++)
{
f=0;
p=b[i];
if(b[i]==-1000)
continue;
for(j=i+1;j<k;j++)
{
if(b[i]==b[j])
{
b[j]=-1000;
continue;
}
if((b[i]+b[j])==25)
{
f=1;
q=b[j];
b[j]=-1000;
}
}
if(f==1)
printf("\npair found %d and %d produce 25 as result of the addition",p,q);
}
getch();
return 0;
}