int main()
{
int l[10],a,b,c=0,s;
printf("Enter the size of array You want :-");
scanf("%d",&a);
printf("Enter the elements in the array :-\n");
for(b=0;b {
scanf("%d",&l[b]);
}
printf("\nThe elements in the array are :-");
for(b=0;b {
printf(" %d",l[b]);
}
printf("\n");
printf("Enter your sum number :-");
scanf("%d",&s);
for(b=0;b {
if (l[b]+l[b+1]==s)
c=c+1;
}
printf("Adjacent numbers whose sum is \'%d\' having pairs are : \'%d\'\n",s,c);
}
No comments:
Post a Comment