Explaining the C++ statements

Here is my attempt to explain the different parts of the C++ code.

Preprocessor Directive section: During compilation the #include is getting the iostream library (created by someone) and adding it on top of our C++ program, so it can use the objects within the iostream library. (eg: std::cout, std:cin, etc)

Int Main Function: The main function is where the meat of the program is. Logic and expressions and contained in this section. Every C++ program will need this int Main function.

Expression Statements: The expression statements is code that interfaces with the user and deals with logic.

Declaration Statements: The declaration statement is code that assign values to variables.

The Return Statement: If the int main function returns 0 then that means that the function has successfully ran.

1 Like

Great job!!

Privacy & Terms