ValerianBenchea

Afisarea cifrelor pare

Oct 30th, 2019
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.22 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.    int n, c;
  8.    cout<<"n="; cin>>n;
  9.  
  10.    while(n!=0)
  11.     {
  12.        c=n%10;
  13.        if(n%2==0)
  14.        cout<<c<<" ";
  15.        n=n/10;
  16.  
  17.     }
  18.         return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment