Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int sumeven(int num)
- {
- int counter;
- if(num < 10)
- return num;
- counter = num % 10;
- return ((sumeven(num / 10) + counter) % 2 == 0) ? 1 : 0;
- }
- void main()
- {
- printf("%d\n", sumeven(879176));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement