My C++ Quiz

The ultimate place to learn C++!

Question #34: What value gets printed by the program?

#include <iostream>

int main(int argc, char** argv)
{
  int x = 0;
  int y = 0;

  if (x++ && y++)
  {
    y += 2;
  }

  std::cout << x + y << std::endl;

  return 0;
}