hello,i must solve this problem : "Sum all even digits of a given number. That's what i've got so far.
#include <iostream>
using namespace std;
int main() {
int sum = 0 , num;
cin>>num;
while(num > 0)
{
sum+=num%10;
num/=10;
}
cout<<sum;
return 0;
}
the problem is that this program sum all digits (odd & even), but i need to sum even digits... help pls.