#include <iostream>
using namespace std;
int main() {
int n;
cout<<" enter a number : "<<endl;
cin>>n; // input
int x;
x = 0;
while (n>0){ // loop initialize < helps to recheck the number for extraction of single digit>
int y; // taking integer to store extracted single digit repetedly
y = n%10; //extraction of single digit
if ( y%2==0){ // if condition for whatever we want
x = x + y; // whatever we wanna do with numbers like add substract or multiply
}
n = n/10; // for the extraction of remaining numbers from input
} //loop end here
cout<<x; // printing of final number
}
To embed this project on your website, copy the following code and paste it into your website's HTML: