Guest User

Untitled

a guest
Jan 22nd, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.30 KB | None | 0 0
  1. //inversão de números tendo um vector
  2.  
  3. #include <stdio.h>
  4. #include <stdlib.h>
  5.  
  6. int vec[10]={3,4,7,8};
  7.  
  8. void pares ();
  9. int main(){
  10.  
  11. pares();
  12.  
  13. return 0;
  14.  
  15. }
  16.  
  17. void pares(){
  18. int i;
  19. int *ap;
  20.  
  21. ap=vec;
  22.  
  23. for(i=0;i<4;i++)
  24. {
  25.  
  26. if(vec[i]%2==0){
  27.  
  28. printf("%d\n",*ap);
  29. }
  30.  
  31. ap++;
  32. }
  33.  
  34.  
  35. }
Add Comment
Please, Sign In to add comment