When I ran this program:
#include int sqr(int&); int main() { int a=5; std::cout<<\"Square of (5) is: \"<< sqr(a)
Your function sqr() has no return statement. The function has undefined behavior concerning return value. Your first output shows this return value.
sqr()
The compiler should show a diagnostic though.
try this:
int sqr(int x) { return x*x; }