// Showing that functions get a copy of values passed in. // // g++ -o add2nums add2nums.cpp // #include // here is the definition of the function add2nums // int add2nums( int firstnum, int secondnum ) { int sum; sum = firstnum + secondnum; // just to make a point firstnum = 0; secondnum = 0; // return(sum); } int main(void) { int y,a,b; cout << "Enter 2 numbers\n"; cin >> a >> b; y = add2nums(a,b); cout << "a is " << a << endl; cout << "b is " << b << endl; cout << "y is " << y << endl; return(0); }