Problem Statement - Output Writing – passing integers as ref and as def value
Write the output of the following C++ program code:
Note: Assume all required header files are already being included in the program.
void Location(int &X,int Y=4) { Y+=2; X+=Y; } void main() { int PX=l0,PY=2; Location(PY) ; cout<<PX<<","<<PY<<endl ; Location(PX,PY); cout<<PX<<","<<PY<<endl ; }
Solution
CSKC| Created: 7-Jan-2019 | Updated: 20-Feb-2020|CBSE12A-2015