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 series(int x=10) { for(int i=2;i<=x;i+=2) cout<<i<<" "; cout<<endl; } void modify(int &n) { n*=2; series(n); } int main() { int a=10; cout<<"a="<<a<<endl; modify(a); series(); cout<<"new a="<<a<<endl; return 0; }