Created
April 10, 2016 14:10
-
-
Save dangnhdev/2afb8fd751f018df446c5156f9b284d0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
#include<conio.h> | |
main() | |
{ | |
int n; | |
int tong=0; | |
printf("nhap vao so phan tu cua mang:"); | |
scanf("%d",&n); | |
int mang[n]; | |
for(int i =0; i<n; i++){ | |
printf("nhap vao phan tu thu %d :", i+1); | |
scanf("%d",&mang[i]); | |
} | |
for(int i =0; i<n; i++){ | |
if(mang[i]<0) | |
printf("%d",mang[i]); | |
if(mang[i]%2 ==0) | |
tong = tong+mang[i]; | |
} | |
printf("\ntong cac so chan la: %d",tong); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment