Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main () {
- int element;
- printf("How many element you want?\n");
- scanf("%d",&element);
- int a[element];
- int x,i,j,o,got = 0;
- printf("What is your expected Sumation?\n");
- scanf("%d",&x);
- printf("please insert array elements here \n");
- for (o = 0; o < element; o++) {
- scanf("%d",&a[o]);
- }
- for (i=0; i < (element - 1); i++) {
- for (j = (i+1); j < element; j++) {
- if ( x == (a[i] + a[j]) ) {
- got = 1;
- }
- }
- }
- if (got == 1) {
- printf("Exists");
- } else {
- printf("NONE");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement