>THe code in red is not needed. The reason for this is becasue its before main() so the compiler already knows it was there.

My compiler freaks out if I don't declare a function prototype before I define the function.

>in blue i've added using namespace std;
I can understand std::cout better then cout <<.
The reason I did this was so that I could see exactly what was going on in my code, doing the latter just makes me ignorant to the inner workings of the program, thats the only reason why but yes it's not needed other then that. The output is the same.