Analyze the following programs and write down the output of the program. Please print every character (including whitespace character) clearly!
# include <iostream>
using namespace std;
int fun( int a )
{
int b = a * 2;
return b;
}
int main()
{
int y = 5;
cout << fun(y) << endl;
cout << fun(-- y) << endl;
cout << fun(y--) << endl;
cout << y <<endl;
return 0;
}
Output:
10
8
8
3
Execution Step by Step:
Get Answers For Free
Most questions answered within 1 hours.