This simple code should determine if a two digit number contain odd digits only mixed numbers or even numbers only.
I couldn`t test it because the output doesn`t even an option on the code,to the value 19 he prints the word "only" which is just a part of a sentence.
What I did wrong and how thats happened?
You stumbled upon an interesting behavior.
String literals are actually just pointers at run time. "even digits only \n" + (a*b) actually means some_pointer + (a*b) which is, itself, some pointer to something. Most of the time, this pointer will end up in the memory region around that particular string. Often in the middle of a string.
To print more than one thing, you need to do
std::cout <<"even digits only \n" <<(a*b) <<std::endl;