Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(){
- int vetor[10];
- int a,neg,soma;
- neg=0;
- soma=0;
- for (a=0 ; a<10 ; a++){
- scanf("%d",&vetor[a]);
- }
- for (a = 0 ; a < 10 ; a++){
- if(vetor[a] < 0){
- neg++;
- }
- else{
- soma=soma+vetor[a];
- }
- }
- printf("%d numeros negativos\n", neg);
- printf("%d", soma);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement