I wrote an int function without the return statement, but it still works, the code prints 4. Why?
#include <iostream>
#include<cstdlib>
using namespace std;
int quadrato1(int a)
{
a = a * a;
}
int main()
{
int x = 2;
int y = quadrato1(x);
cout << y << endl;
system("pause");
return 0;
}