Guest User

Untitled

a guest
May 16th, 2018
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.39 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std ;
  3.  
  4.  
  5. int ifIsEvenNumber(int num);
  6.  
  7. void main()
  8. {
  9.     int num ;
  10.  
  11.     cout<<"hello please enter a number \n ";
  12.     cin>>num ;
  13.  
  14.     ifIsEvenNumber(num);
  15.     cout<<ifIsEvenNumber <<endl ;
  16.  
  17.    
  18. }
  19.  
  20. int ifIsEvenNumber(int num)
  21. {
  22.     if(num==0)
  23.         return 1 ;
  24.  
  25.     if ((num%10)%2 == 0)
  26.         return ifIsEvenNumber(num/10)+1 ;
  27.     else
  28.         return ifIsEvenNumber(num/10);
  29.    
  30. }
Add Comment
Please, Sign In to add comment