#include <iostream>
usingnamespace std;
int main ()
{
int n;
int numDigits = 0, numEvens = 0;
int numOdds = 0, sumDigits = 0;
int aDigit;
int sumEvenDigits;
cout << "Enter a positive number: ";
cin >> n;
while (n > 0)
{
aDigit = n % 10; // Get the last digit
numDigits++;
sumDigits += aDigit;
//sumEvenDigits += sumDigits + numEvens;
if (aDigit % 2)
++numOdds;
else
++numEvens;
n /= 10;
}
cout << "The no of digits is " << numDigits << endl;
cout << "The no of odd digits is " << numOdds << endl;
cout << "The no of even digts is " << numEvens << endl;
cout << "The sum of all digits is " << sumDigits << endl;
cout << "The sum of even digits is " << sumEvenDigits << endl;
return 0;
}