Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. resultado = verificaPar(vetor, N, 0, 0); // verificando o retorno(quantidade)
  2.  
  3. if(resultado > 0)
  4. {
  5.  
  6. printf("Quantidade de numeros pares: %dn", resultado);
  7. }// printando a quantidade
  8. else
  9. {
  10. printf("Nao ha numeros paresn");
  11. }
  12. return 0;
  13.  
  14. if(v[indice]%2 == 0) //verificação pra ver se o numero daquela posicao é par.
  15. {
  16. qtd++;
  17. }
  18. if( v[indice] >= n-1) // verifica se o indice chegou ao final do total de numeros do vetor.(n-1 pq a ultima posicao tem n-1 d indice)
  19. {
  20. verificaPar(v,n,qtd, indice+1);
  21. }
  22.  
  23. else
  24. {
  25. return qtd; // se sim, devolve a quantidade acumulada de numeros pares.
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement