Odd/Even Digits in a Number-Help!
Hey everyone, I need some help doing this ..i got most of the source code, but there's a little problem. When I input a three digit number, sometimes it'll tell me that the digits are odd/even/mixed when i know they're not.
"Digits are Mixed(odd and even)" <THIS is wrong
"All Digits are even" <This is right
"Digits are Mixed(odd and even)" <this is also right
What could be the problem in my code...Take a Look Please
int Num, Dig1,Dig2,Dig3,Val1,Val2,Val3;
cout << "Please enter a 3 digit number and Press
Enter : ";
cin >> Num;
if((Val1==0) && (Val2==0) && (Val3==0))
cout<<"All Digits are Even";
else if((Val1>0) && (Val2>0) &&(Val3>0))
cout<<"All Digits are Odd";
cout<<"The Digits are Mixed (Odd and Even)";
Thanks for taking a look