Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n, s=0, c;
- cout<<"n="; cin>>n;
- while(n!=0)
- {
- c=n%10;
- if(c%2==0)
- s=s+c;
- n=n/10;
- }
- cout<<"Suma este "<<s;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment