Advertisement
STANAANDREY

ex2

Jan 18th, 2019
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.28 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7.  
  8.  unsigned long n,nr,uc;
  9.  
  10.  cout<<"n=";cin>>n;
  11.  nr=0;
  12.  while (n)
  13.  {
  14.      uc=n%10;
  15.      if (uc%2==0)
  16.         nr++;
  17.  
  18.      n/=10;
  19.  }
  20.  
  21.  cout<<"nr cifre pare="<<nr;
  22.  
  23.  return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement