include stdio include stdlib define run this program using the console

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <stdio.h>
#include <stdlib.h>
#define N 6
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char *argv[]) {
int x,y,i,sum;
int A[N];
printf("x=");
scanf("%d",&x);
printf("y=");
scanf("%d",&y);
printf("Vvedite massive:");
for (i=0;i<N;i++)
scanf("%d", &A[i]);
sum=0;
for (i=0;i<N;i++)
if (A[i]>x && A[i]<y)
sum+=A[i];
printf("sum= %d", sum);
system("PAUSE");
return 0;
}