My C++ Quiz

The ultimate place to learn C++!

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

#include <iostream>

int foo(int y);
int foo(int x)
{
  return x+1;
}

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

  std::cout << foo(x) << std::endl;

  return 0;
}