Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #define SIZE 10
- int main()
- {
- int i,summ,counter,arr[SIZE]= {1,2,3,4,5,6,7,8,9,10};
- summ = counter = 0;
- for(i=0;i<SIZE;i++)
- {
- if( !(i%2) && arr[i]>0)
- {
- summ+= arr[i];
- counter++;
- }
- }
- printf("counter %d,summ %d,average %f\n",counter,summ,summ/counter);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement