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