Code: #include <iostream> using namespace std; int f(int x); int g(int x); int main() { int x = 1; cout << f(x) + g(x); return 0; } int f(int x) { x = x + 1; cout << x; return g(x); } int g(int x) { x = x + 1; cout << x; return x; } Okay I don't see how this prints out 2325 I've started out by doing this f(x) 1 + 1 equals 2...then I sent the value to g(x) now for g(x) x equals 2 + 1 which is 3 ....now i returned 3 back to main...but i dont see how 5 is coming into play with this? I also thought that you can't return values to main??? Very confused please help

I don't even know the ABC of C++. I tried to learn C++ 2 months ago but left it because of not having enough time.

In have in the order : in the main : from f(x) -> cout << x -> which gives 2 then it goes to g(x) from f(x) where you have cout<< x -> which gives 3 at this moment bear in mind that f(x) return 3 you're now back in the main : from g(x) -> cout << x -> which gives 2 and g(x) return 2 and finally you have cout << f(x) + g(x) that gives 3 + 2 = 5 So the output is 2325. The idea is to understand that from the main, you evaluate f(x) (and in this f(x) you have also a g(x)), then g(x) and then cout<<f(x) + g(x). I hope it's not too confusing.

How is the exam structured? Home exam? In that case you could just hire someone over at fiverr or craigslist to do the work for you.

Lol no im in college at a university...plus i would never do that because it will come to bite me back in the end