My C++ Quiz

The ultimate place to learn C++!

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

#include <iostream>

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

int main(int argc, char** argv) 
{ 
  std::cout << foo(2) << std::endl; 
  return 0; 
}