[Solved] Errors: expected expression and expression result unused [closed]


Haven’t used C++ in a while but i think it should look something like this

if(x%2 == 0) 
{
  std::cout << x << "is even\n";
} 
else 
{
  std::cout << x << "is odd\n";
}

your errors are because you were basically saying

cout << x;
"is even";

which doesn’t make sense to the compiler or to anyone what exactly is supposed to happen with “is even”

solved Errors: expected expression and expression result unused [closed]