I am just learning C++ and I was doing an example which involved function prototypes, and defining functions and have a problem with pausing the program after it returns it's last value.. This towards the end of the program.
Code:
...
areaOfYard= Area(lengthOfYard,widthOfYard);
cout << "\nYour yard is ";
cout << areaOfYard;
cout << " square feet\n\n";
return 0;
}
int Area(int l, int w)
{
return l * w;
}
Now the code before this block just shows the prototype function and the it declares the tye of value lengthOfYard etc. and asks the user for the values. At first I put "system ("pause");" function after return zero, but the final output didn't finish correctly because of the pause function. So I took that out of there and put it after the "return l * w;" but it still ended abruptly, How do I pause the program for future code's like these