find the numbers of pairs whose sum is 10 in c array
#include <stdio.h>
void main ()
{
int a[10];
int i,j;
for (i=0;i<10;i++)
{
printf("Enter %d number: ",i+1);
scanf("%d",&a[i]);
}
int count=0;
for (i = 0; i < 10; ++i)
{
for(j=i+1;j<10;j++)
{
if (a[i] + a[j] == 10)
count++;
}
}
printf("The number of pairs that have sum of 10 is %d",count);
}