What is wrong with this code for TAAND problem?

Any help will be appreciated

#include<stdio.h>
int main()
{long long int a[5000],c[1000],b;
int n,i,j,k;
int count=0;
scanf("%d",&n);
for(i=0;i<n;i++)
 {scanf("%d",&a[i]);
 }
for(i=0;i<n;i++)
 {for(j=i+1;j<n;j++)
 if(a[i]<a[j])
  {b=a[i]&a[j];
  c[count]=b;
  count++;
  }
 }
printf("%d",c[count-1]);
return 0;
}