Topic: Output
Program #1 Output
1) #include <iostream.h>
2) int main(){
3) cout<<"Hello World\n";
4) return 0;
5) }
--------------------------------------------------------------------------------------
This tutorial will explian each line of code in a short but understandable manner.
Line 1: This line is called the include directive it is save on your hard drive as iostream.h. It tells the compiler that you will be accessing it for your program.
Line 2: For now what you should konw is - int main () is the area of the program that is actually visible to the user.
Line 3: cout is a command we use from the directive in line 1. To print text to the screen a pair of double qoutes are use, with the actual text is in between the qoutes. the \n tells the computer to print a new line.
Line 4: This line is used by the compiler to check if the program ran successfully.
Line 5: Simply closes the { we had in line 1. The text between the {} is called the body.