Return statement in C++ :
-The return statement terminates the execution of a function and returns control to the calling function.
-We control goes on return statement then it return from that function.
program:
#include < iostream>
using namespace std;
int sqaure(int n)
{
return n*n;
cout<<"This is after return";
}
int main()
{
int n,a;
cout<<"Enter number";
cin>>n;
a=sqaure(n);
cout<<"sqaure is: "<< a;
return 0;
}
Enter number
3
sqaure is: 9