Advertisement
Guest User

Untitled

a guest
Nov 14th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int contapar(int n, int cont)
  4. {
  5. int quo, res, resu;
  6.  
  7. quo = n / 10;
  8. res = n % 10;
  9.  
  10. if (res % 2 == 0)
  11. {
  12. cont++;
  13. }
  14. if (quo != 0)
  15. {
  16. contapar(quo, cont);
  17. }
  18. else
  19. {
  20. return cont;
  21. }
  22.  
  23. }
  24.  
  25. int main()
  26. {
  27. int n, pares;
  28.  
  29. scanf("%d", &n);
  30.  
  31. pares = contapar(n, 0);
  32.  
  33. printf("%d", pares);
  34.  
  35. return 0;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement