Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std ;
- int ifIsEvenNumber(int num);
- void main()
- {
- int num ;
- cout<<"hello please enter a number \n ";
- cin>>num ;
- ifIsEvenNumber(num);
- cout<<ifIsEvenNumber <<endl ;
- }
- int ifIsEvenNumber(int num)
- {
- if(num==0)
- return 1 ;
- if ((num%10)%2 == 0)
- return ifIsEvenNumber(num/10)+1 ;
- else
- return ifIsEvenNumber(num/10);
- }
Add Comment
Please, Sign In to add comment