i found this code in some site that it doesn't have any return statement for returning the value. But in the site it is written as it gives a compile time error. While i was trying to compile the program for knowing what the error will be seen in compiler. The program compiled successfully with out giving any error..
The c++ code is :
int multiply(int x, int y)
{
int product = x * y;
}
int main()
{
cout << multiply(4, 5) << endl;
return 0;
}
output : 20
Now I am confused that without any return statement how the compilation is successful.