find the numbers of pairs whose sum is 10 in c array

Solutions on MaxInterview for find the numbers of pairs whose sum is 10 in c array by the best coders in the world

showing results for - "find the numbers of pairs whose sum is 10 in c array"
Giorgia
18 Aug 2019
1#include <stdio.h>
2void main ()
3{
4    int a[10];
5    int i,j;
6
7    for (i=0;i<10;i++)
8    {
9        printf("Enter %d number: ",i+1);
10        scanf("%d",&a[i]);
11    }
12
13    int count=0;
14
15    for (i = 0; i < 10; ++i)
16    {
17        for(j=i+1;j<10;j++)
18        {
19            if (a[i] + a[j] == 10)
20                count++;
21        }
22    }
23
24    printf("The number of pairs that have sum of 10 is %d",count);
25}
queries leading to this page
given an array 2c find all pairs of numbers whose sum is equal to number n find the number of pairs in an array whose sum is xhow do you find all pairs of an integer array whose sum is equal to a given number 3ffind the number of pairs whose sum is xwrite a program in c to find a pair with given sum multiple in the arraypairs of elements in array whose sum is equal to 10how do you find all pairs of an integer array whose sum is equal to a given numberfind the number of pairs in array whose sum 3e 3dxsolutions to find pair of integers in array whose sum is given numberfind all pairs of elements with a given sum such that each pair equals s c programfind all pairs with a given sum c programgiven numbers in array 2c find all pairs whose sum is a multiple of 60 given an array of integers 2c and a number e2 80 98sum e2 80 99 2c find the number of pairs of integers in the array whose sum is equal to e2 80 98sum e2 80 99 find all pairs with a given sum such that each pair equals s c programgiven an array 2c find all pairs of numbers whose sum is equal to number nhow to find all pairs in an array of integers whose sum is equal to the given numberto find all the pairs of an integer array whose sum is equals to a given numbehow to find all pairs on integer array whose sum is equal to given number 3fgiven an array of integers find all the pairsthat make up a given sumgiven an array and a number find all pairs which sumwrite a program in c to find a pair with given sum in the array find the numbers of pairs whose sum is 10 in c array