I am a newbie at this and I am confused on how to go on to solve these two questions. Any help and walkthroughs in explaining on how to do this will be nice.
What is the output of the following code snippet if Question6_() is called by main.
int six_(int i, int j=4)
{
return i+j+1;
}
void Question6_()
{
cout << six_(3,six_(5)) << endl;
}
What is the output of the following code? (Hint: the code will not error and do pay attention to where the “endl”s are)
short function2(int i)
{
return i / 2;
}
int function(int i)
{
i = i * 3;
return i - 1;
}
int main()
{
int number = 7;
int left = function(number);
cout << number;
cout << function2(left) << endl;