Lets understand each and every thing in detail :- 1. // indicates that everything following it until the end of the line is a comment: it is ignored by the compiler. Another way to write a comment is to put it between /* and */ (e.g. x = 1 + /*sneaky comment here*/ 1;). A comment of this form may span multiple lines. Comments exist to explain non-obvious things going on in the code. Use them: document your code well! 2. Lines beginning with # are preprocessor commands, which usually change what code is actually being compiled. #include tells the preprocessor to dump in the contents of another file, here the iostream file, which defines the procedures for input/output. 4. int main() {...}defines the code that should execute when the program starts up. The curly braces represent grouping of multiple commands into a block. More about this syntax in the next few lectures. 5. • cout << : This is the syntax for outputting some piece of text to the scree...
Learn C++ Programming fast and easy, find C++ Program Codes