daily pastebin goal
48%
SHARE
TWEET

Untitled

a guest May 16th, 2018 106 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top