Advertisement
Guest User

dawd

a guest
Nov 21st, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. int cifMaxPar(int numar)
  2. {
  3. if(numar < 10) {
  4. if(numar % 2 == 0)
  5. return numar;
  6. else
  7. return -1;
  8. }
  9. else {
  10. if(numar % 2 == 1) // ultima cifra este impara
  11. return cifMaxPar(numar / 10);
  12. else
  13. return max( numar % 10, cifMaxPar(numar / 10) );
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement